-
Notifications
You must be signed in to change notification settings - Fork 39
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
How to insert and return an auto-generated value #74
Comments
A great question! We certainly need to document this, but here are a few solutions at the moment:
Rel8 actually used to have special support for default values, with a special insertion context - but that was removed in 1eaa683. Ultimately we felt that tracking all of this at the type level was just too much. It also put the definition in the I hope this helps. I'll keep this open as a reminder to add documentation about |
It sure would be nice if the |
I have a typical sort of situation here where there's a table with an auto-incrementing ID (the "position" column in the schema below)...
... and I want to insert into the table, let the database set the position field to its default value, and return the generated value.
What do I put in the hole above? Should I write
unsafeLiteral "DEFAULT"
? Or is there some other approach I'm missing?The text was updated successfully, but these errors were encountered: