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

PersistField Int should parse PersistRational #1527

Open
parsonsmatt opened this issue Feb 6, 2024 · 1 comment
Open

PersistField Int should parse PersistRational #1527

parsonsmatt opened this issue Feb 6, 2024 · 1 comment

Comments

@parsonsmatt
Copy link
Collaborator

The instance PersistField Int does not work with the Postgres numeric type, which shows up repeatedly for the esqueleto library.

Link to code.

We should really probably just make PersistRational work.

bitemyapp/esqueleto#82
bitemyapp/esqueleto#54
bitemyapp/esqueleto#175

@parsonsmatt
Copy link
Collaborator Author

Thoughts:

I don't like floor. That feels like... throwing away information that may be pertinent.

If the Rational is like x % 1 then I think it's totally fine to just return x directly.

But if it's x % y where the value isn't integral, then that feels like a Left to me.

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

No branches or pull requests

1 participant