Repository navigation
feat: a declaration on a split entity lands on the table that has its columns - #192
Merged
Merged
Conversation
… columns An entity split over tables has its key's columns in each and every other column in one. A declaration is resolved in each table and lands on the one where no path lacks a column. None: refused, with the tables named. More than one, a declaration over the key alone: the first; with SQL written by hand it is refused, since nothing says which table the SQL means. The resolver's refusal of a path without a column carries its path, and only that refusal is taken for "not this table". A derived type with a table of its own that reads an inherited column is refused with the base type named. Closes #191 Co-Authored-By: Claude Fable 5.2 <[email protected]>
CaffeinatedCoder
enabled auto-merge
November 25, 2026 12:29
This was referenced Nov 25, 2026
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 #191
The last of three slices of #118, after #187 and #189.
Problem
SplitToTable): a declaration was resolved against the type's first table, so one that reads a column of the second was refused as having no column.Change
Landings.Fragments), and lands on the one where no path lacks a column. None: refused, with the tables named. More than one, which is a declaration over the key's columns alone: the first table; with SQL written by hand it is refused.MissingColumn) and stays theInvalidOperationExceptionthe contract says. Only that refusal is taken for "not this table": a path that names no property fails as itself.EnsureCreated()builds it, and refuses overlapping rows (On_a_split_entity_the_table_with_the_column_refuses_overlapping_rows).On the way: the first form made the refusal a type of its own derived from
InvalidOperationException, andA_property_with_no_column_in_the_table_is_refusedfailed, since it asserts the exact type. The full offline run showed it, not the tests I ran first.Tests
Offline: 763 (kernel), 199 (PostgreSQL package), 87 (second provider). Live: 4 and 76 on PostgreSQL 16 and on 18, 86 on SQL Server 2022. The consumer smoke test: 47 rows.
Nine rules were changed in turn. A test failed for eight:
A_declaration_on_a_split_entity_lands_on_the_table_that_has_its_columnson three providers, the refusal's test, both of the PostgreSQL package'sA_constraint_on_a_split_entity_is_in_the_table_that_has_its_columnsA_constraint_on_a_split_entity_is_in_the_table_that_has_its_columnsA_declaration_over_columns_of_two_tables_of_a_split_entity_is_refused, and the PostgreSQL package'sA_declaration_on_a_derived_type_that_reads_an_inherited_column_names_the_base_typeA_path_that_names_no_property_of_a_split_entity_fails_as_itselfNot held by a test:
InheritedFromleaves out the declaring type when it is the entity type itself. It keeps the message from saying a type inherits from itself; no model I know reaches it, since a type's own property has a column in its own table.🤖 Generated with Claude Code