Repository navigation
refactor: Resolve options in a single pass shared by every insert path - #105
Merged
Merged
Conversation
Each option now resolves itself into the node's option set: traits expand in place, sequence options become the plain option for the current record, and Ref options resolve straight into the child set of their relation. Root placement, Seq outside InsertMany, and after-insert callback types are checked as each option resolves, so the separate expansion, collection, and validation passes and the dead planner sequence field are gone. Only under Ref is now rejected alongside the other root-only options.
Only is rejected under Ref while the options resolve, so the planner no longer threads an allowOnly flag through validation to repeat that check; a nested option set simply never carries Only.
The same option streams now run through InsertOneE, BuildE, InsertManyE, and both Builder insert methods, fixing the order in which Set, Generate, With, traits, merged Refs, Use, and WithContext take effect and the placement errors every path reports.
…ules The guide, package godoc, architecture notes, and test-setup skill now state the order options take effect in, which options replace, merge, or accumulate, the fixed Defaults, Generate, Set, and With stages, and the options limited to the root record, including Only.
Code Metrics Report
Details | | main (69d7a67) | #105 (5646616) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 86.6% | 87.1% | +0.4% |
| Files | 59 | 60 | +1 |
| Lines | 4781 | 4761 | -20 |
+ | Covered | 4145 | 4147 | +2 |
+ | Code to Test Ratio | 1:1.0 | 1:1.0 | +0.0 |
| Code | 17853 | 17808 | -45 |
+ | Test | 18610 | 18853 | +243 |
- | Test Execution Time | 1m18s | 1m22s | +4s |Code coverage of files in pull request scope (88.5% → 89.7%, patch 97.2%)
Reported by octocov |
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
InsertOne,InsertMany,Build, and theBuilder: traits expand in place, sequence options resolve per record,Refresolves straight into its relation's option set, and placement rules are checked as each option resolvesOnlyunderRefis rejected together with the other root-only options, and the planner no longer carries a dead sequence field or a duplicateOnlyplacement checkChanges
SeqoutsideInsertMany, and after-insert callback types are rejected during resolution, wherever the option is writtenRefs to the same relation merge into one child set in written order, and the unused plannerSeqsfield is removedallowOnlyflag and nested-Onlycheck, since a nested option set can no longer carryOnlyInsertOneE,BuildE,InsertManyE, and bothBuilderinsert methods, covering Set/Generate/With stages, traits, merged Refs, Use, and WithContextOnly