purescript-selda
purescript-selda copied to clipboard
Different Expr type for different backends - Count & Max return type
pg returns the result of the COUT/MAX as String, because of potential precision loss.
While other backends can return Int
there (and losing some digits if the result does not fit the Int
range)
It is useful to have the expression of type Col s Int
rather than Col s String
e.g. comparison on strings is different than on ints.
Potential solution:
- drop the appropriate type in the Expr AST
- add CAST expression (extend Expr)
- implement count, max_ and other related functions per backend
I think we should handle this using purescript-bigints
if possible in case of postgresql and not String
.