Skip to content

feat(flow-php/postgresql): data-modifying CTEs, SEARCH/CYCLE and RETURNING aliases in query builder - #2755

Merged
norberttech merged 1 commit into
1.xfrom
pg-query-builder-cte
Nov 19, 2026
Merged

norberttech merged 1 commit into
1.xfrom
pg-query-builder-cte

Conversation

@norberttech

Copy link
Copy Markdown
Member

Resolves: #2747

Change Log


Added

  • flow-php/postgresql - INSERT, UPDATE, DELETE and MERGE queries in cte()
  • flow-php/postgresql - SEARCH and CYCLE clauses on recursive CTEs
  • flow-php/postgresql - MERGE returning(), returningAll() and merge_action()
  • flow-php/postgresql - returningAliases() for RETURNING WITH (OLD AS, NEW AS)
  • flow-php/postgresql - in_subquery() for IN (subquery) conditions

Fixed

  • flow-php/postgresql - fromAst() dropping SEARCH, CYCLE and RETURNING aliases
  • flow-php/postgresql - fromAst() failing on IN, ANY and EXISTS subqueries
  • flow-php/postgresql - aliased expressions in RETURNING

Changed

  • flow-php/postgresql - returning() without expressions throws
  • flow-php/postgresql - recursive WITH on MERGE throws at build time

Removed

  • flow-php/postgresql - recursive argument of cte() and CTE
  • flow-php/postgresql - returning() and returning_all() DSL functions
  • flow-php/postgresql - ReturningClause::all() and ReturningClause::columns()

Deprecated

Security

…RNING aliases in query builder

- cte() accepts INSERT, UPDATE, DELETE and MERGE queries
- SEARCH and CYCLE on recursive CTEs
- MERGE RETURNING with merge_action()
- RETURNING WITH (OLD AS, NEW AS) through returningAliases()
- in_subquery(), IN/ANY/EXISTS subqueries kept by fromAst()
- removed dead cte() recursive flag and returning()/returning_all() DSL

Closes #2747
@norberttech norberttech added this to the 0.49.0 milestone Nov 19, 2026
@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.46154% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.10%. Comparing base (aab6f66) to head (39409e5).
⚠️ Report is 1 commits behind head on 1.x.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##                1.x    #2755      +/-   ##
============================================
+ Coverage     91.08%   91.10%   +0.02%     
- Complexity    32322    32376      +54     
============================================
  Files          2240     2242       +2     
  Lines         93397    93501     +104     
============================================
+ Hits          85068    85185     +117     
+ Misses         8329     8316      -13     
Components Coverage Δ
etl 96.24% <ø> (ø)
cli 87.40% <ø> (ø)
lib-array-dot 96.52% <ø> (ø)
lib-azure-sdk 69.50% <ø> (ø)
lib-doctrine-dbal-bulk 94.44% <ø> (ø)
lib-filesystem 89.10% <ø> (ø)
lib-types 94.64% <ø> (ø)
lib-parquet 82.80% <ø> (ø)
lib-parquet-viewer 83.15% <ø> (ø)
lib-snappy 89.42% <ø> (-0.45%) ⬇️
lib-dremel 0.00% <ø> (ø)
lib-postgresql 90.55% <93.46%> (+0.10%) ⬆️
lib-telemetry 86.85% <ø> (ø)
bridge-filesystem-async-aws 96.85% <ø> (ø)
bridge-filesystem-azure 95.66% <ø> (ø)
bridge-filesystem-sftp 90.29% <ø> (ø)
bridge-monolog-http 96.84% <ø> (ø)
bridge-monolog-telemetry 92.85% <ø> (ø)
bridge-openapi-specification 91.95% <ø> (ø)
symfony-http-foundation 80.76% <ø> (ø)
bridge-symfony-console 98.01% <ø> (ø)
bridge-psr18-telemetry 100.00% <ø> (ø)
bridge-psr3-telemetry 98.95% <ø> (ø)
bridge-psr7-telemetry 100.00% <ø> (ø)
bridge-telemetry-otlp 90.11% <ø> (ø)
bridge-symfony-http-foundation-telemetry 92.85% <ø> (ø)
bridge-symfony-filesystem-bundle 93.19% <ø> (ø)
bridge-symfony-filesystem-cache 98.18% <ø> (ø)
bridge-symfony-postgresql-bundle 93.72% <ø> (ø)
bridge-symfony-postgresql-cache 94.41% <ø> (ø)
bridge-symfony-postgresql-messenger 98.80% <ø> (ø)
bridge-symfony-postgresql-session 93.65% <ø> (ø)
bridge-symfony-telemetry-bundle 90.76% <ø> (ø)
adapter-chartjs 82.46% <ø> (ø)
adapter-csv 97.68% <ø> (ø)
adapter-doctrine 95.14% <ø> (ø)
adapter-google-sheet 97.53% <ø> (ø)
adapter-http 87.40% <ø> (ø)
adapter-json 90.62% <ø> (ø)
adapter-logger 47.05% <ø> (ø)
adapter-parquet 96.95% <ø> (ø)
adapter-text 97.68% <ø> (ø)
adapter-xml 98.01% <ø> (ø)
adapter-avro 6.25% <ø> (ø)
adapter-excel 96.79% <ø> (ø)
adapter-postgresql 97.35% <ø> (ø)
adapter-seal 90.00% <ø> (ø)
bridge-phpunit-postgresql 75.30% <ø> (ø)
bridge-phpunit-telemetry 87.36% <ø> (ø)
bridge-phpstan-types 0.00% <ø> (ø)
bridge-postgresql-valinor 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@norberttech
norberttech merged commit a6707a8 into 1.x Nov 19, 2026
22 checks passed
@norberttech
norberttech deleted the pg-query-builder-cte branch November 19, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Proposal]: Accept DELETE, UPDATE and INSERT queries in cte()

1 participant