Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR consolidates include dispatch onto single-query strategies, removes multi-query stitching, adds reloadMutationRowsByIdentities for mutation read-back by identity, updates mutation RETURNING projection logic and delete-with-includes snapshots, and adjusts unit and integration tests. ChangesMulti-query removal and single-query mutation includes consolidation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
18d4bb5 to
55c703b
Compare
@prisma-next/extension-author-tools
@prisma-next/mongo-runtime
@prisma-next/family-mongo
@prisma-next/sql-runtime
@prisma-next/family-sql
@prisma-next/extension-arktype-json
@prisma-next/extension-cipherstash
@prisma-next/middleware-cache
@prisma-next/mongo
@prisma-next/extension-paradedb
@prisma-next/extension-pgvector
@prisma-next/extension-postgis
@prisma-next/postgres
@prisma-next/sql-orm-client
@prisma-next/sqlite
@prisma-next/target-mongo
@prisma-next/adapter-mongo
@prisma-next/driver-mongo
@prisma-next/contract
@prisma-next/utils
@prisma-next/config
@prisma-next/errors
@prisma-next/framework-components
@prisma-next/operations
@prisma-next/ts-render
@prisma-next/contract-authoring
@prisma-next/ids
@prisma-next/psl-parser
@prisma-next/psl-printer
@prisma-next/cli
@prisma-next/cli-telemetry
@prisma-next/emitter
@prisma-next/migration-tools
prisma-next
@prisma-next/vite-plugin-contract-emit
@prisma-next/mongo-codec
@prisma-next/mongo-contract
@prisma-next/mongo-value
@prisma-next/mongo-contract-psl
@prisma-next/mongo-contract-ts
@prisma-next/mongo-emitter
@prisma-next/mongo-schema-ir
@prisma-next/mongo-query-ast
@prisma-next/mongo-orm
@prisma-next/mongo-query-builder
@prisma-next/mongo-lowering
@prisma-next/mongo-wire
@prisma-next/sql-contract
@prisma-next/sql-errors
@prisma-next/sql-operations
@prisma-next/sql-schema-ir
@prisma-next/sql-contract-psl
@prisma-next/sql-contract-ts
@prisma-next/sql-contract-emitter
@prisma-next/sql-lane-query-builder
@prisma-next/sql-relational-core
@prisma-next/sql-builder
@prisma-next/target-postgres
@prisma-next/target-sqlite
@prisma-next/adapter-postgres
@prisma-next/adapter-sqlite
@prisma-next/driver-postgres
@prisma-next/driver-sqlite
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/integration/test/sql-orm-client/nested-includes-strategy.test.ts (1)
8-13:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winFix the stale “three strategies” wording in the header.
After removing the multi-query path, this suite only compares lateral vs correlated. Leaving “three strategies” here makes the contract comment inaccurate for future readers.
Suggested wording
-// benchmark drift. The cross-strategy equivalence tests then assert -// that the three strategies produce byte-identical result trees over -// the same data. +// benchmark drift. The cross-strategy equivalence tests then assert +// that both single-query strategies produce byte-identical result +// trees over the same data.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/integration/test/sql-orm-client/nested-includes-strategy.test.ts` around lines 8 - 13, Update the stale header comment that refers to “three strategies” in nested-includes-strategy.test.ts to reflect the current two-strategy comparison (lateral vs correlated); locate the top comment block containing the phrase "three strategies" and replace it with wording that states the suite pins SQL-execution count per strategy for the two strategies (lateral and correlated) and that cross-strategy equivalence asserts byte-identical result trees over the same data.
🧹 Nitpick comments (1)
test/integration/test/sql-orm-client/update.test.ts (1)
130-145: ⚡ Quick winAssert the exact projected row shape here.
This test currently proves the relations are bucketed correctly, but
arrayContaining()would still pass if the internal identity columns added for read-back leaked back into the public payload. Since this PR changes that projection path, it’s worth pinning the exact keys returned byselect('name').include(...).One way to tighten the assertion
- expect(updated).toEqual( - expect.arrayContaining([ - { - name: 'Ready', - posts: [{ id: 10, title: 'Post A', userId: 1, views: 100, embedding: null }], - }, - { - name: 'Ready', - posts: [ - { id: 11, title: 'Post B', userId: 2, views: 200, embedding: null }, - { id: 12, title: 'Post C', userId: 2, views: 300, embedding: null }, - ], - }, - ]), - ); - expect(updated).toHaveLength(2); + const normalized = [...updated].sort( + (left, right) => left.posts[0]!.userId - right.posts[0]!.userId, + ); + expect(normalized).toEqual([ + { + name: 'Ready', + posts: [{ id: 10, title: 'Post A', userId: 1, views: 100, embedding: null }], + }, + { + name: 'Ready', + posts: [ + { id: 11, title: 'Post B', userId: 2, views: 200, embedding: null }, + { id: 12, title: 'Post C', userId: 2, views: 300, embedding: null }, + ], + }, + ]);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/integration/test/sql-orm-client/update.test.ts` around lines 130 - 145, The test currently uses expect.arrayContaining which permits extra leaked keys; replace that with an exact equality assertion on the updated variable so the returned rows contain only the projected keys from select('name').include(...). Concretely, update the assertion around the updated variable to expect(updated).toEqual([...]) with the exact two-element array of objects (each object only has name and posts, and each post only has id, title, userId, views, embedding null), and remove or keep the toHaveLength(2) check as redundant; this ensures no internal identity columns leak into the public payload.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/integration/test/sql-orm-client/nested-includes.test.ts`:
- Around line 1-3: The top-of-file comment incorrectly claims coverage for "both
... lateral and correlated" strategies while the tests call
createUsersCollection(runtime) and never override capabilities, so update the
header/comment in nested-includes.test.ts to state it exercises the default
lateral path only (or "default lateral strategy"), and add a brief pointer that
cross-strategy coverage is in nested-includes-strategy.test.ts; reference the
file name and the createUsersCollection(runtime) calls to locate the tests to be
clarified.
---
Outside diff comments:
In `@test/integration/test/sql-orm-client/nested-includes-strategy.test.ts`:
- Around line 8-13: Update the stale header comment that refers to “three
strategies” in nested-includes-strategy.test.ts to reflect the current
two-strategy comparison (lateral vs correlated); locate the top comment block
containing the phrase "three strategies" and replace it with wording that states
the suite pins SQL-execution count per strategy for the two strategies (lateral
and correlated) and that cross-strategy equivalence asserts byte-identical
result trees over the same data.
---
Nitpick comments:
In `@test/integration/test/sql-orm-client/update.test.ts`:
- Around line 130-145: The test currently uses expect.arrayContaining which
permits extra leaked keys; replace that with an exact equality assertion on the
updated variable so the returned rows contain only the projected keys from
select('name').include(...). Concretely, update the assertion around the updated
variable to expect(updated).toEqual([...]) with the exact two-element array of
objects (each object only has name and posts, and each post only has id, title,
userId, views, embedding null), and remove or keep the toHaveLength(2) check as
redundant; this ensures no internal identity columns leak into the public
payload.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: f0c9f9ff-8063-4786-8bc4-e45dc5a3fe30
📒 Files selected for processing (18)
packages/3-extensions/sql-orm-client/src/collection-dispatch.tspackages/3-extensions/sql-orm-client/src/collection-mutation-dispatch.tspackages/3-extensions/sql-orm-client/src/collection.tspackages/3-extensions/sql-orm-client/src/include-strategy.tspackages/3-extensions/sql-orm-client/src/query-plan-select.tspackages/3-extensions/sql-orm-client/src/query-plan.tspackages/3-extensions/sql-orm-client/test/collection-dispatch.test.tspackages/3-extensions/sql-orm-client/test/collection-mutation-dispatch.test.tspackages/3-extensions/sql-orm-client/test/include-strategy.test.tspackages/3-extensions/sql-orm-client/test/query-plan-select.test.tstest/integration/test/sql-orm-client/create.test.tstest/integration/test/sql-orm-client/delete.test.tstest/integration/test/sql-orm-client/include.test.tstest/integration/test/sql-orm-client/nested-includes-distinct.test.tstest/integration/test/sql-orm-client/nested-includes-helpers.tstest/integration/test/sql-orm-client/nested-includes-strategy.test.tstest/integration/test/sql-orm-client/nested-includes.test.tstest/integration/test/sql-orm-client/update.test.ts
💤 Files with no reviewable changes (1)
- test/integration/test/sql-orm-client/include.test.ts
|
@coderabbitai Re: the "outside diff range" finding on |
|
@coderabbitai Re: the nitpick on |
|
Tip For best results, initiate chat on the files or code changes.
If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! |
|
Tip For best results, initiate chat on the files or code changes.
🐇 ✨ If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! |
|
Done in ec4e091 (CodeRabbit outside-diff comment on nested-includes-strategy.test.ts): fixed the stale 'three strategies' wording — only lateral and correlated remain after the multi-query path was removed, and the header now says both single-query strategies produce byte-identical result trees over the same data. |
|
Done in ba04dcf (CodeRabbit nitpick on update.test.ts): replaced expect.arrayContaining with an exact toEqual over a deterministically sorted array, so a read-back identity column leaking into the public payload now fails the test. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/3-extensions/sql-orm-client/src/collection-mutation-dispatch.ts`:
- Around line 129-137: The code incorrectly passes tableName to
mapStorageRowToModelFields causing wrong field mapping when model and table
names differ; update the call in the loop to pass modelName (instead of
tableName) to mapStorageRowToModelFields, and while here, ensure
stripHiddenMappedFields is also called with modelName for consistency with
dispatchMutationRows (which uses modelName); adjust the arguments to use the
modelName variable so mappings and hidden-field stripping use the model
identity, not the physical table name.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 689d5dce-13ba-44ca-84f6-107387e79322
📒 Files selected for processing (8)
packages/3-extensions/sql-orm-client/src/collection-dispatch.tspackages/3-extensions/sql-orm-client/src/collection-mutation-dispatch.tspackages/3-extensions/sql-orm-client/src/collection.tspackages/3-extensions/sql-orm-client/test/collection-mutation-dispatch.test.tstest/integration/test/sql-orm-client/mutation-include-readback.test.tstest/integration/test/sql-orm-client/nested-includes-strategy.test.tstest/integration/test/sql-orm-client/nested-includes.test.tstest/integration/test/sql-orm-client/update.test.ts
✅ Files skipped from review due to trivial changes (1)
- test/integration/test/sql-orm-client/nested-includes.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- test/integration/test/sql-orm-client/update.test.ts
- test/integration/test/sql-orm-client/nested-includes-strategy.test.ts
aqrln
left a comment
There was a problem hiding this comment.
There are two failing CI pipelines right now @tensordreams
|
Acknowledged — the one actionable finding in this review (the |
|
Acknowledged — will get CI green before this is ready. The two red pipelines should resolve as the streaming / lazy-transform fixes from this round land; will confirm both are green after pushing. |
|
Both failing pipelines are fixed and pushed (e39ba99): Lint — the |
…e read path The multi-query include strategy and its JS-side stitcher were dead on the read path once every supported SQL target became lateral/correlated- capable (TML-2594/2595/2656). Rather than relocate the stitcher — which the mutation read-back still imported — migrate that read-back onto the single-query lateral/correlated builders so the entire stitcher chain can be deleted with no in-tree caller remaining. - include-strategy: narrow IncludeStrategy to 'lateral' | 'correlated'; selectIncludeStrategy keys purely on the `lateral` capability. - collection-dispatch: delete dispatchWithMultiQueryIncludes and the whole stitcher chain; add loadIncludesForMutationRows — one single-query read-back keyed by identity IN (...). - collection-mutation-dispatch / collection: attach mutation includes via the read-back; delete/deleteAll + include read a pre-delete snapshot before issuing the DELETE. - query-plan-select: remove compileRelationSelect (stitcher-only). - tests: recast strategy cases to correlated, rewrite mutation-dispatch to the read-back shape, drop multi-query fallback tests, add PG integration coverage for create/update/delete + include. Refs: TML-2657 Signed-off-by: Alexey Orlenko's AI Agent <[email protected]>
Collapse the trivial dispatchWithIncludeStrategy wrapper into dispatchWithIncludes (single-query is the only include path now) and rewrite the routing comment to describe the lateral/correlated split in plain words instead of citing transient tickets. Signed-off-by: Alexey Orlenko's AI Agent <[email protected]>
Drop the trailing transient-ticket reference from the loadIncludesForMutationRows JSDoc; the one-round-trip identity-keyed read-back is already described directly. Signed-off-by: Alexey Orlenko's AI Agent <[email protected]>
State explicitly that the include snapshot is drained into an array via .toArray() while the rows still exist, so the yielded iteration walks an in-memory array rather than a cursor over deleted rows. No change to execution order. Signed-off-by: Alexey Orlenko's AI Agent <[email protected]>
This suite only exercises the default lateral contract; reword the header to say so and point at nested-includes-strategy.test.ts for cross-strategy coverage. Signed-off-by: Alexey Orlenko's AI Agent <[email protected]>
After the multi-query path was removed only lateral and correlated remain; correct the cross-strategy-equivalence wording accordingly. Signed-off-by: Alexey Orlenko's AI Agent <[email protected]>
Replace arrayContaining with an exact toEqual over a deterministically sorted array so a read-back identity column leaking into the public payload fails the test. Signed-off-by: Alexey Orlenko's AI Agent <[email protected]>
Add an integration suite exercising every write that can carry `.include()` — create / createAll / update / updateAll / upsert (both branches) / delete / deleteAll — plus to-one, to-many, nested, scalar count(), and combine() relations. Two conventions make these a stable safety net for the upcoming read-back consolidation (TML-2657): explicit `.select(...)` projections at every level (so adding a model field never silently shifts an expected shape) and whole-object/array `toEqual` assertions (so a leaked read-back identity column, a mis-keyed relation, or a dropped field all fail loudly). Refs: TML-2657 Signed-off-by: Alexey Orlenko's AI Agent <[email protected]>
`loadIncludesForMutationRows` was a second include read-back implementation living alongside the read path: it compiled a single- query include plan, drained it, re-keyed by identity, and grafted the decoded relations onto the RETURNING-derived rows. That duplicated the read path's compile / map / decode / hidden-strip logic and could drift from it. Collapse it. With includes, a mutation now returns only its identity columns; those rows are reloaded through `dispatchCollectionRows` — re-selecting the caller's projection plus the relations, keyed by `identity IN (...)`, on the same runtime (same transaction) the mutation ran on. Scalars therefore come from the read-back, not RETURNING, which is identical within the transaction. Behavioural equivalence is now structural: one read path, not two. This is the consolidation the read path's delete snapshot and nested-mutation reload already use. - collection-dispatch: replace loadIncludesForMutationRows with reloadMutationRowsByIdentities (a thin caller of dispatchCollectionRows); drop the now-dead grafting helpers (assignEmptyMutationIncludes, emptyIncludeValue). - collection-mutation-dispatch: include branches reload via identities; no-include branches unchanged. - collection: #augmentMutationSelection returns identity-only RETURNING when includes are present; thread selectedFields to the dispatchers. - tests: include read-back is now covered by the mutation-include-readback integration suite; drop the unit cases that pinned the old grafting. Refs: TML-2657 Signed-off-by: Alexey Orlenko's AI Agent <[email protected]>
Address review of the read-path consolidation: - reloadMutationRowsByIdentities returns the read-path AsyncIterableResult directly instead of `.toArray()`; the dispatchers `yield*` it and the single-row path advances it once, so nothing buffers the read-back into an array only to re-stream it. - buildIdentityInFilter no longer dedups identities in JS — they come straight from RETURNING and are unique by construction; the database evaluates the IN list (or the composite-key OR). Drops the now-dead uniqueByKey / identityKey helpers and the noNonNullAssertion on the single-column branch. - dispatchSplitMutationRows: real fix — the no-includes branch mapped via `tableName` where `modelName` is required (wrong field mapping when they differ); it now also transforms each plan's rows lazily rather than buffering per plan. - include-strategy: drop the stale parenthetical history note from the selectIncludeStrategy JSDoc. Refs: TML-2657 Signed-off-by: Alexey Orlenko's AI Agent <[email protected]>
…back - createAll() with include() resolving non-empty relations (the existing create-include test only proved an empty relation). - nested create() and deep nested create() read-backs, with explicit projections at every level, in the mutation-include-readback suite. Refs: TML-2657 Signed-off-by: Alexey Orlenko's AI Agent <[email protected]>
…eout "loads the side-by-side fixture files from disk" inherited the 100ms package default; reading + parsing the fixtures is local I/O that flakes on cold CI workers (the Fixtures pipeline timed out here). Use vitestPackageDefault, the helper documented for this exact case. Pre- existing flake, unrelated to the read-back change. Signed-off-by: Alexey Orlenko's AI Agent <[email protected]>
e39ba99 to
2d5162c
Compare
size-limit report 📦
|
Linked issue
Refs TML-2657.
Unblocked by the now-merged TML-2594 (nested includes), TML-2595 (
combine()/count()), and TML-2656 (distinct()on non-leaf include) — together they made every in-tree SQL target lateral/correlated-capable, so the multi-query fallback became unreachable on reads.At a glance
Previously this returned a third arm,
'multiQuery', which dispatched to a JS-side stitcher that fired one SELECT per relation per depth level (N+1) and stitched the results in memory. That arm — and its entire stitcher — is gone.Summary
This PR removes the multi-query include strategy from the SQL ORM. The deliverable is three things, not one:
jsonAggtarget). The'multiQuery'arm ofselectIncludeStrategyand theIncludeStrategytype both narrow to'lateral' | 'correlated'..include()read-back (create/createAll/update/updateAll/upsert) no longer uses the stitcher. It now resolves relations with a single follow-up SELECT keyed by the mutated rows' identity, lowered through the same lateral/correlated builders the read path uses.delete/deleteAll+.include()reads a pre-delete snapshot before issuing the DELETE.dispatchWithMultiQueryIncludes, the wholestitchXchain, and the stitcher-onlycompileRelationSelectplanner helper are deleted.Per ADR 164, mutation orchestration (CREATE-without-RETURNING, nested creates, FK cascades —
transaction()/connection()) is untouched; only the include read-back changed.Notes for the reviewer
collection-mutation-dispatch.tsimportedstitchIncludesand used it in every mutation read-back. So the stitchers were not dead. Rather than relocate them (keeping two divergent include-loading codepaths and the N+1 read-back), we migrated the mutation read-back onto the single-query builders so the stitcher could be deleted outright. This was an explicit, agreed scope expansion.jsonAggtarget) is covered at the unit/compile level (compileSelectWithIncludeStrategy(..., 'correlated')). The ORM integration harness here is PGlite-only, so there is no separate SQLite integration leg to run.collection-dispatch.ts. Worth spot-checking that the kept single-query decode helpers (decodeIncludePayload,decodeCombineIncludePayload,coerceSingleQueryIncludeResult,emptyScalarResult) survived the deletion intact.IN (...)and composite identity viaORof per-rowAND-equals; the bucketing key is bigint-safe.How it fits together
selectIncludeStrategydrops thejsonAgg-fallback logic and keys purely on thelateralcapability;IncludeStrategybecomes'lateral' | 'correlated'.dispatchWithIncludeStrategycollapses to a single call into the single-query path.loadIncludesForMutationRowstakes the rows a mutation'sRETURNINGproduced, builds anidentity IN (...)filter, compiles one lateral/correlated SELECT carrying the include columns, decodes the JSON aggregates, and assigns them onto each parent — bucketed by identity. It runs on the caller's already-acquired scope so it observes the just-written rows in the same connection/transaction.stitchIncludes;collection.tsaugments the mutationRETURNINGwith identity columns when includes are present.delete/deleteAlltake the read-before-delete branch.dispatchWithMultiQueryIncludes, the stitcher chain, andcompileRelationSelect(plus its re-export) come out.correlated; mutation-dispatch unit tests rewritten to the read-back shape; multi-query fallback tests deleted; PG integration coverage added for create/update/delete + include.Behavior changes & evidence
src/include-strategy.ts,src/collection-dispatch.ts· evidence:test/include-strategy.test.ts,test/collection-dispatch.test.ts.include()read-back resolves in one SELECT, not N+1.create/createAll/update/updateAll/upsertattach relations via a single identity-keyed read-back. —src/collection-dispatch.ts(loadIncludesForMutationRows),src/collection-mutation-dispatch.ts· evidence:test/collection-mutation-dispatch.test.ts,test/integration/test/sql-orm-client/create.test.ts,update.test.tsdelete()/deleteAll()+.include()returns a pre-delete snapshot of the row's relations. —src/collection.ts(#executeDeleteReturningWithIncludes) · evidence:test/integration/test/sql-orm-client/delete.test.tscompileRelationSelectare removed. —src/collection-dispatch.ts,src/query-plan-select.tstest/integration/test/sql-orm-client/nested-includes-strategy.test.tsTesting performed
pnpm --filter @prisma-next/sql-orm-client typecheck— cleanpnpm lint:deps— clean (994 modules, 2056 dependencies)pnpm build— full Turbo build, 66 taskspnpm --filter @prisma-next/sql-orm-client test— 515 passed, 3 skippedpnpm test:integration(sql-orm-client suite, PGlite) — 172 passed across 23 filescli-telemetry"populates the agent field for Gemini CLI sessions" test fails only because the suite runs inside Claude Code and detects'Claude Code'instead of the simulated agent. Not touched by this PR.Skill update
n/a — internal only. Nothing in
sql-orm-client's public exports changed; the affected symbols (dispatchWithMultiQueryIncludes, the stitchers,compileRelationSelect,IncludeStrategy) are all package-internal.Follow-ups
posts.include({ comments: { take: 5 } })) on Postgres, where LATERAL is the canonical pattern and correlated-with-json_agg-over-LIMIThas weaker planner-decorrelation guarantees.Alternatives considered
jsonAgg. Rejected per the ticket's accepted constraint: every supported SQL target now providesjsonAgg; targets without it are out of scope on the read path by policy.VALUESkey-set so relations could be loaded after the DELETE (preserving exact post-delete semantics). Rejected: more invasive (it touches builders the ticket deliberately keeps as-is) and the pre-delete snapshot is the more intuitive contract for "return the row I just deleted, with its relations."Checklist
git commit -s) per the DCO.TML-NNNN: <sentence-case title>form.n/a — internal only).Summary by CodeRabbit
New Features
Behavior Changes
Bug Fixes
Tests