Skip to content

Support Data-modifying CTE's #290

Description

@smaccoun

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions