Repository navigation
feat!: creates and drops follow what an object says it needs - #196
Merged
Merged
Conversation
Dependency.SchemaObject takes the object's scope beside its owner and its name: a name alone does not say which object is meant where names are taken within a table. Within a phase a create comes after the creates of what it needs and a drop before their drops, whatever the placement and the model's order say. What needs nothing keeps the order it had. Refused: objects that need each other in a circle, an object created before the tables that needs one created after them, and, in the context's own model, a dependency on an object the model does not declare. Closes #195 Co-Authored-By: Claude Fable 5.2 <[email protected]>
CaffeinatedCoder
enabled auto-merge
November 25, 2026 13:53
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 #195
Slice B of #115 (decided 2026-11-25), after slice A (#145).
Problem
Creates were ordered by placement and then by the model's order, and drops the other way round.
Dependency.SchemaObjectsays an object needs another, and nothing kept that order: a trigger whose stored key sorts before its function's was created before it. The dependency held an owner and a name and no scope, so it could not say which table's object it means.Change
Dependency.SchemaObject(Owner, Scope, Name). Which object is needed is the three together, as its descriptor says them.DependencyOrderTests).A_dependency_on_an_index_says_which_tables_index_it_means.Not here:
EnsureSchemaof its schema: slice C.Dependency.SchemaObjectyet. The row guard (RowGuard: delete guards as declared triggers, with one raise-only function #47) is the first.Tests
Offline: 771 (kernel), 199 (PostgreSQL package), 90 (second provider); the API probes: 127. Live: 4 and 76 on PostgreSQL 16 and on 18, 86 on SQL Server 2022. The consumer smoke test: 47 rows. The live suites, the probes and the smoke test ran before the last two tests were added; nothing under
src/changed after them.Ten rules were changed in turn and a test failed for each:
A_chain_is_created_from_its_foot_and_dropped_from_its_head, the circle's testA_chain_is_created_from_its_foot_and_dropped_from_its_headWhat_is_created_before_the_tables_cannot_need_what_is_created_after_themWhat_tables_are_made_of_is_ordered_among_itself, after a chain of three replaced the pair the first run showed held nothingWhat_is_created_before_the_tables_cannot_need_what_is_created_after_themA_dependency_on_an_object_the_model_does_not_declare_is_refused_in_the_contexts_own_modelAn_object_of_the_same_name_in_another_scope_is_not_the_one_that_is_neededAn_object_of_the_same_name_of_another_owner_is_not_the_one_that_is_needed, added after the first run showed nothing held itObjects_that_need_each_other_in_a_circle_are_refused_with_their_namesbreaking:Dependency.SchemaObjecthas a third member, in the contract (SK9001).🤖 Generated with Claude Code