This is a feature I'd love to have. I use data-modifying CTE's all the time, primarily to write transactionally robust queries that fill junction tables. In fact, they are useful for almost any one:many or many:many where you don't want to write several queries that get wrapped in a transaction.
I'm sure they have many other use cases, but this is an extremely common one. Here's a stack overflow illustrating it.
https://stackoverflow.com/questions/20561254/insert-data-in-3-tables-at-a-time-using-postgres
This would just have to be an added RETURNING statement to the upcoming WITH support in Beam. As far as I know only Postgres supports it (Oracle maybe, not sure). Here are the actual docs on it
https://www.postgresql.org/docs/current/static/queries-with.html#QUERIES-WITH-MODIFYING
This is a feature I'd love to have. I use data-modifying CTE's all the time, primarily to write transactionally robust queries that fill junction tables. In fact, they are useful for almost any one:many or many:many where you don't want to write several queries that get wrapped in a transaction.
I'm sure they have many other use cases, but this is an extremely common one. Here's a stack overflow illustrating it.
https://stackoverflow.com/questions/20561254/insert-data-in-3-tables-at-a-time-using-postgres
This would just have to be an added
RETURNINGstatement to the upcomingWITHsupport in Beam. As far as I know only Postgres supports it (Oracle maybe, not sure). Here are the actual docs on ithttps://www.postgresql.org/docs/current/static/queries-with.html#QUERIES-WITH-MODIFYING