Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Actually there is no way of creating a query with
With a simple infix it would create something like that:
However SELECT FROM UPDATE is not a valid SQL command in Postgres.
Any update on this? Pretty surprised this common use-case isn't supported at all, and even though the following compiles, it doesn't contain any "RETURNING" clause in the generated SQL:
Ideally we would be able to return the whole inserted row.
We came across this issue as well. We return inserted entities as complete row (id, timestamps are generated by DB). With the current implementation we are forced to do a second query to select the previously created entity. Even a workaround of returning multiple fields is not possible with the current API.
I didn't dig deep enough at the code to get an understanding in how complex it will be to implement that feature - if it's possible at all.
EDIT: @pettyjamesm as far as I saw this happens during runtime. Postgres displayed the RETURNING clause at the logs.
EDIT2: maybe someone of the maintainers will respond to the feature request originated in 2016?