Repository navigation
Replace dynamic builders with typed immutable state - #2
Merged
Merged
Conversation
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.
Replace reflection-based
lann/builderstate with private typed immutable state across SELECT, INSERT, UPDATE, DELETE, CASE, CTE, and statement builders. Persistent typed lists keep branching independent and avoid quadratic copying in long query chains. The root module now has no external dependencies; SQL rendering and final-pass placeholder numbering are retained.Compatibility requires review before merging:
lann/builder.Builder, and externalbuilder.Set/GetStructcalls, are no longer supported.Adds a differential harness against published v0.1.0, concurrent branch/render regression tests, reproducible benchmarks, and CI checks. Representative construction-plus-rendering benchmarks use 53–65% fewer allocations (SELECT: 58 → 23); shared-host timing measurements improved in all measured scenarios but are not production performance guarantees.
Validation:
scripts/test-all.shpassed on Go 1.26.2 with real PostgreSQL 18.1, including lint, unit/race, fuzz, differential comparison, dependency policy, module tidy, API inventory, compatibility, and integration checks.See implementation report for raw benchmark links, compatibility details, and the remaining maintainer adoption decision. This PR is the separate post-v0.1.0 replacement stream; it does not publish a release.