Repository navigation
test(compiler): run reference service subqueries, CTEs, and bulk writes - #83
Merged
omer-cengel merged 1 commit intoOct 14, 2026
Conversation
Drop the subquery casts the membership checks no longer need, and add a NOT EXISTS check, a CTE report, a subquery source, a multi-row insert, an unnest bulk insert, an INSERT ... SELECT, an UPDATE ... FROM, and a DELETE ... USING to the reference service, each executed against PostgreSQL 16 through the generated repository. The unsupported catalogue gains a recursive and a data-modifying CTE.
omer-cengel
deleted the
chore/reference-service-nested-queries-and-multi-row-writes
branch
October 14, 2026 19:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The reference service now exercises the nested-query and multi-row write shapes sqlcj analyzes: its membership checks compile without subquery casts, and new queries covering subqueries, CTEs, multi-row and
SELECT-sourced inserts, and joined writes run against PostgreSQL 16 through the generated repository. This proves those shapes on a realistic migration history rather than only in focused tests.Changes
::bigintcasts from theEXISTSandIN (SELECT ...)membership checks; their placeholders are now typed from columns, and the existing assertions pass unchanged.NOT EXISTScheck, a CTE report joined toprojects, an aliased subquery source with aLIMITplaceholder, a two-rowVALUESinsert sharing one placeholder, anINSERT ... SELECT ... unnest(:userIds::bigint[]) ON CONFLICT DO NOTHING, anINSERT ... SELECTfromtasks, anUPDATE ... FROM projects ... RETURNING t.*, and aDELETE ... USING tasks.NOT EXISTSfilter, the CTE counts at two priority bounds, the subqueryLIMIT, and that the joined update returns the shared task row record.Scope and non-goals
pg_dumpsnapshot still generate one byte-identical tree with the same file set.ListTasksWithRecentCommentsstays, since projection subqueries are still typed only by casts.LATERAL, views as sources, JDBC batch execution,COPY, and aggregate typing remain unsupported.