Repository navigation
feat!: SQL in a declaration is stored as segments, format v 3 - #182
Merged
Merged
Conversation
The first slice of #114. A lambda's SQL was one string with {Path} placeholders, which the resolver scanned at every diff. It is a SqlTemplate now: text a package wrote, a column by its property path, and SQL written by hand, stored as a list in which a string is package text, {"col":…} a column and {"raw":…} hand-written SQL. - The resolver reads segments and scans nothing. Hand-written SQL reads the whole table beside the columns it names by a path; a package's own text reads nothing. - Predicate and KeyTarget.Template hold a SqlTemplate and are not made from a string. Predicate.And composes segments, and hand-written SQL that reads like its text is not taken for a conjunct. - PgExclusion stores sql and where as segments. An expression and a filter of a 5.x snapshot are read as SQL written by hand. - v is 3. A v of 2, 11.0.0-preview.1's, is refused with a message that says to scaffold again. - The version is 11.0.0-preview.2, with its changelog section. The default name's rule is unchanged: it is built from the segments by the same letters and digits as before, so that an object 5.x named keeps its name at the handover. Closes #178 Co-Authored-By: Claude Fable 5.2 <[email protected]>
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.
Closes #178
Problem
A lambda's SQL was stored as one string with
{Path}placeholders, and the resolver found the columns by scanning that string at every diff. A brace in a quoted identifier or a dollar-quoted string was taken for a placeholder, a template that mixed{A}with a column written by hand recordedAalone, andPredicate.Andsearched SQL text for a conjunct (#83). #114 decided the stored form on 2026-11-24: segments. This is its first slice; the translator still runs at the call.Change
SqlTemplate, a value of segments:SqlSegment.Text(text a package wrote, which names no column),Column(a property path) andRaw(SQL written by hand). Stored as a list:["lower(",{"col":"Email.Value"},") = 'a'"],{"raw":…}for the third. The template is unmarked and shows no SQL string; what makes one and itsSegmentsare the contract's.PredicateandKeyTarget.Templatehold aSqlTemplateand are not made from a string.Predicate.Andcomposes segments.PgExclusionstoressqlandwhereas segments. The 5.x reader reads an expression and a filter as SQL written by hand.vis 3. Avof 2 is refused with a message that says to scaffold again (SchemaKit: snapshot format v2 and CodoMetis: annotation keys ship in 11.0.0; the 5.x format is read forever (D11) #9).11.0.0-preview.2, with its changelog section, which also has the line of Npgsql EF 11.0.0 is out: the floors move from rc.3 to [11.0.0, 12.0.0) #174.Not as #178 was written, and recorded there:
lowerfirstnametolowerfirst_nameat the handover from 5.x.PredicateandKeyTarget.Templatehave their new public shape already, which Binder, slice 2: a declaration is held unbound until the model is finalized, then bound and checked #179 lists.{Path}is still looked for once, where a package's text or a 5.x filter becomes segments. Nothing stored is scanned.Tests
Measured on 2026-11-24:
11.0.0-preview.2.Each rule removed in turn, with the test that failed:
Sql_written_by_hand_depends_on_the_whole_table, the rename testA_filter_of_5x_may_read_a_column_it_does_not_name_by_a_pathAnd's textHand_written_sql_that_reads_like_a_conjunct_is_noneAndOnly_a_conjunct_And_itself_wrote_is_taken_for_oneA_template_in_another_shape_is_refusedvof 2 is refusedA_format_version_this_version_does_not_know_is_refused🤖 Generated with Claude Code