You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the SQL standard, I believe all aggregates can return a null in certain situations (except for COUNT). The correct way (mentioned in the beam docs as well - https://haskell-beam.github.io/beam/user-guide/queries/aggregates/ -- see the note on returning null and use of coalesce_) is to use coalesce. One of the advantages / disadvantages of the type checker is that your queries must be NULL-correct!
Say we have following table:
In this query,
max
is nullable because table may not have specific name, and application must handle it:but in this query, return value of
max
is never null:Beam seems to always assume that result of
max
aggregate is nullable with following type:Is there any way to express this distinction and get precise type, or I have no choice but to use
fromJust
?The text was updated successfully, but these errors were encountered: