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

Fix 4441 PostgreSql Dialect auxilary CTE #4493

Merged
merged 6 commits into from
Aug 28, 2023
Merged

Conversation

griffio
Copy link
Contributor

@griffio griffio commented Aug 5, 2023

This is implemented in PostgreSql Dialect as PostgreSQL allows CTEs to contain INSERT/UPDATE/DELETE statements.

Add an override SqlInsertStmtMixin , SqlDeleteStmtLimitedMixin , UpdateStmtLimitedMixin
Add test fixtures

closes #4441

@griffio
Copy link
Contributor Author

griffio commented Aug 7, 2023

Last build was cancelled needs to be run again ♻️

@griffio griffio force-pushed the fix-4441 branch 2 times, most recently from cf76579 to 082e789 Compare August 16, 2023 10:43
Add mixin to override tablesAvailable

For insert statement check the parent auxillary with clause
Auxillary with clause using insert populated by select
Delete statements can reference CTE
referencing cte from auxilary delete statement
reference cte from update statement
for update statement
@AlecKazakova AlecKazakova merged commit d5a209f into cashapp:master Aug 28, 2023
7 checks passed
hfhbd pushed a commit that referenced this pull request Apr 2, 2024
* add PostgreSql Dialect SqlInsertStmtMixin

Add mixin to override tablesAvailable

For insert statement check the parent auxillary with clause

* Add fixture

Auxillary with clause using insert populated by select

* Include support for delete stmt with mixin

Delete statements can reference CTE

* Add fixture

referencing cte from auxilary delete statement

* add support for update statement

reference cte from update statement

* add fixture

for update statement

---------

Co-authored-by: griffio <griffio@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

PostgreSQL CTEs auxiliary statements cannot reference each other
2 participants