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

Insert returning values? #4

Open
jackfirth opened this issue Jul 15, 2017 · 1 comment
Open

Insert returning values? #4

jackfirth opened this issue Jul 15, 2017 · 1 comment

Comments

@jackfirth
Copy link

jackfirth commented Jul 15, 2017

I'd like to create a row in a table with an auto-incrementing primary key, retrieve the generated key, and read the value later. Some SQL variants allow specifying that an INSERT statement should return values, e.g. Postgres has the INSERT ... RETURNING clause, Sqlite has the last_insert_rowid() function, SQL Server has INSERT ... OUTPUT, etc. Would a #:returning keyword listing column names make sense for the insert syntax?

@rmculpepper
Copy link
Owner

I would like to support (some) extensions like PostgreSQL's RETURNING clause, but I haven't decided how to do that yet. And I don't want to try to unify extentions that are too different. For example, it seems like it might be reasonable to unify PostgreSQL's RETURNING and SQL Server's OUTPUT, but it would not make sense to try to unify those with Sqlite's last_insert_rowid().

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

2 participants