Repository navigation
Plan a catalog for the default database together with one for every database, under its registered name - #597
Merged
Merged
Conversation
…atabase, under the database's registered name (#595) A catalog naming 'default' was planned apart from one for every database on the same database, so each warned the other's items were orphans of their owner, and the owner's inventory recorded one half or the other. Each named target, and the databases runtime items are kept by, is now resolved to its registered name, as drivine4j's SchemaTargets resolves it (drivine4j#854).
…e, and drop the NodeId check's name mapping the resolved targets make a no-op (#595)
…atabase by its name, and say the default and every-database catalogs are planned together (#595)
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 #595
A catalog for the default database (
for_default_database()) and a catalog for every database were planned separately, even when they targeted the same database. Each plan saw the other's items as orphans of their owner, so everyenforce()logged false "no longer declares" warnings. The owner's recorded inventory then held only one half.Each database a catalog names is now resolved to the name it is registered under, as drivine4j does (drivine4j#854). That covers
defaulttoo, and so do the databases that runtime items are kept by. Each database is then planned once, with all of its owner's items:SchemaManager._targetsresolves each named database and removes duplicates, so naming bothdefaultand the database itself targets it once.ensure_catalogandremove_catalogkeep and drop runtime items by the registered name, so items ensured fordefaultcan be removed by a catalog that names the database, and the other way round.@NodeIdcheck no longer maps names itself, since the resolved targets already carry the registered name.Tests (
tests/unit/test_schema_default_target.py, SQLite, async and sync):defaultare applied with the catalog's items and removed by the database's name.defaultis the first one registered and only that one.defaultand the database targets it once.tests/unit/test_node_id_index_check.py: a catalog ensured fordefaultis catalogued and listed on the database by its registered name.Whole suite with Oracle (
ORACLE_TESTS=true) on the final commit:tests/integration: 4710 passed, 291 skipped, 7 xfailed, 1 xpassed, 0 failedtests/sync_integration: 4640 passed, 290 skipped, 7 xfailed, 1 xpassed, 0 failedReview: 3 passes, last CLEAN.
defaultand the database, and removed name mappings the resolved targets made no-ops.@NodeIdcheck test for a catalog ensured fordefault, and fixed a docstring.