Open
Conversation
Points the sqlonfhir submodule at the new repeat-updates branch on aehrc/sql-on-fhir-v2 (commit 27ee2c6) which adds twelve test cases expanding repeat-operator coverage. Sets the submodule URL to the aehrc fork so this branch tracks against the staging remote pending the upstream PR to FHIR/sql-on-fhir-v2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the processor-based query generator (ForEachProcessor, RepeatProcessor, SelectClauseBuilder, SelectCombinationExpander) with a new tree-walker compiler in src/queryGenerator/treeWalker/. The new approach walks the ViewDefinition select tree recursively, classifying nodes, generating CTE templates, and rendering T-SQL, making the repeat/forEach nesting logic clearer and easier to extend. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Drops fromClause, rowOrigin/RowOrigin, fromAlias, nullableHere, and the ScalarColumn/Context.scalarColumns machinery that was never populated. Also removes the stale USE_TREE_WALKER gate reference from index.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
Code reviewFound 1 issue:
sof-mssql/src/queryGenerator/treeWalker/operators/repeat.ts Lines 66 to 73 in 5bd6f92 See also the declaration in sof-mssql/src/queryGenerator/treeWalker/types.ts Lines 51 to 54 in 5bd6f92 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
…ers, trim barrel exports Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
johngrimes
requested changes
May 5, 2026
Member
johngrimes
left a comment
There was a problem hiding this comment.
Thanks @piotrszul!
I noticed a few minor issues.
- Fix `joins` → `fromExtensions` in repeat.ts module comment - Fix render.ts template comment to show single `<fromExtensions>` slot - Rewrite mergeSiblings.ts header to describe actual behaviour - Fix unionAll.ts seed alias comment (_seed_X → _seed) with note on why no unique suffix is needed (UNION ALL branches have independent scopes) - Add @param/@returns/@throws JSDoc to all 12 exported treeWalker functions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Closes #8.
Implements the
repeatdirective with no positional constraints beyond the spec's per-select-node mutual exclusion offorEach/forEachOrNull/repeat. Wherever a select node is structurally legal, a select node carryingrepeatis now handled correctly by the query generator.Changes
ForEachProcessor,RepeatProcessor,SelectClauseBuilder,SelectCombinationExpander) with a recursive tree-walker insrc/queryGenerator/treeWalker/. Context (current JSON source, partition keys, accumulated APPLY chain) threads through descent, eliminating the previous post-hoc rewiring step that couldn't represent complex nesting relationships.sqlonfhiradvances toaehrc/sql-on-fhir-v2:repeat-updates(commit27ee2c6), which adds twelve test cases covering the full structural surface of the operator: linear nestings, sibling combinations, triple-nested mixed combinations, and operator-pairing coverage (unionAll inside repeat,multi-path repeat inside forEach, etc.). The submodule URL is repointed to theaehrcfork pending the upstream PR toFHIR/sql-on-fhir-v2.Test plan
sqlonfhir/tests/repeat.jsonpass against the MSSQL implementation.sof-jsreference implementation.FHIR/sql-on-fhir-v2for the new test cases.