-
Notifications
You must be signed in to change notification settings - Fork 115
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
Cannot updateEasy optional field with GENERATED ALWAYS #606
Comments
Could you add the definition of |
This is related to: #591 (comment) |
Can you please try |
That worked. SQL Table
My definitions are as follows:
And the query takes the form:
This variant also works:
Verified that my |
You mean
Does this resolve the issue for you? |
Yes it does! |
SQL Table
Haskell
Query
Problem
This type checks, but throws sql error at runtime:
Best practice with postgresql is to define
id bigint GENERATED ALWAYS AS IDENTITY
instead ofid bigserial
.Further, I was trying to move away from the
readOnly
pattern that some older tutorials have spread.Outcomes
There are two outcomes:
readOnly
style setup, I can update this record (withoutupdateEasy
), but I get a newid
each time. Cannot useupdateEasy
here because of type checker.ASIDE: For the record, that
readOnly
pattern is nice as it guarantees that no one writes to the field and adds a bit of safety around the activity. It would be much better if that pattern could be explicitly supported.The text was updated successfully, but these errors were encountered: