Returning clause support #7069
beikov
started this conversation in
Design Proposals
Replies: 1 comment 1 reply
-
We already do this, don't we? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Many DBs have some kind of RETURNING clause that allows to specify which columns of inserted/updated/deleted rows should be returned from a DML statement. We could also use this mechanism internally for fetching generated values after entity inserts/updates instead of doing full fetches.
I propose a syntax extension for DML statements:
('returning' expression (',' expression)*)?
Emulating this feature, although not easy, should be possible. We'd have to use our multi-table facilities for that purpose, which will first insert ids of entities to modify into a temporary table, then run the DML and finally run a select statement for the returning clause based on the data from the temporary table.
Beta Was this translation helpful? Give feedback.
All reactions