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

Support for arbitrary size integers #61

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kejace
Copy link

@kejace kejace commented Jan 5, 2018

I choose to embed the Integers into the Numeric postgres type.
I'm not sure this is the right thing to do so I'm opening this PR for discussion.

@valderman
Copy link
Owner

This would indeed be nice for PostgreSQL, but what about SQLite? As a general rule, if something works out of the box without importing Database.Selda.PostgreSQL, then it should work with all backends.

A possible solution would be to move the SqlType instance declaration for Integer into selda-postgresql to ensure that one doesn't accidentally use it with the SQLite backend, and mark the LInteger and TInteger constructors as being clearly intended for PostgreSQL use only (by renaming to L/TPGInteger or something). Maybe even create a Database.Selda.PostgreSQL.Types module or similar for the instance, to ensure that you need to be really explicit about wanting to use these types.

A proper, long-term solution would be to add a more general notion of backend-specific types, possibly parameterizing SqlType over a backend, but I think a more hacky implementation of this is fine in the meantime.

@TomMD
Copy link
Contributor

TomMD commented Jan 22, 2021

Seeing as the discussion on Integer support, both here and in the issue tracker, was negative perhaps this should be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants