Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different Expr type for different backends - Count & Max return type #27

Open
Kamirus opened this issue Dec 17, 2019 · 1 comment
Open
Labels
expression-level Change related to database expressions `Col s a` pg Related with the PG backend sqlite3 Related with the SQLite3 backend

Comments

@Kamirus
Copy link
Owner

Kamirus commented Dec 17, 2019

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
@Kamirus Kamirus added enhancement pg Related with the PG backend sqlite3 Related with the SQLite3 backend labels Dec 17, 2019
@paluh
Copy link
Collaborator

paluh commented Dec 17, 2019

I think we should handle this using purescript-bigints if possible in case of postgresql and not String.

@Kamirus Kamirus added expression-level Change related to database expressions `Col s a` and removed enhancement labels Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expression-level Change related to database expressions `Col s a` pg Related with the PG backend sqlite3 Related with the SQLite3 backend
Projects
None yet
Development

No branches or pull requests

2 participants