Repository navigation
Check a lookup by id and a save's lookup read layout 2's index, and a step without the id's JSON is refused by name - #590
Merged
Merged
Conversation
…ndex, and a step without the id's JSON is refused by name
… own SQL literal and error-chain helpers
Merged
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.
This adds the last tests from drivine4j's
NodeIdLookupCrossEngineTest: they check that each lookup of a node by its@NodeIdreads store layout 2's index, and that Postgres's write function refuses a plan step that doesn't carry the id. The behaviour itself is already on main: #533 made every load, delete,related, held-properties and found-stamp lookup by id use the shared module'shasId, read a text id as the id's type, keyed a temporal id by its tag's text, and made SQLite's plan writer find by the id's JSON. #536 made Oracle's write blocks find nodes the same way, and #518 maderefandpatchsteps carry the id. No code and no golden statements change.What the tests check
In
tests/integration/sql/test_node_id_lookup.py, async and sync:strid reads its uniqueness constraint's index on Postgres and SQLite: the load, the delete by id andload_related, as the number and date ids already did.drivine_findprepares on its connection. Called inside one transaction, so on one connection, the prepared statement is explained for the id's JSON, for a number, a date and astrid. Each must be an index scan of the id's uniqueness constraint, with an index condition onprops -> 'id'and no sequential scan of the nodes.reforpatchstep without the id's JSON is refused by name bydrivine_write: "A plan step that finds a node by id carries no id". Before, such a step would find no node and read as absent.Oracle's lookup plans are tested in drivine4j's suite, as this file's existing index tests note. drivine4j has no Oracle save-lookup or refused-step test.
loadNearestAmong's cases aren't ported. That method is only in drivine4j.Closes #509.
Testing
tests/integration/sql/test_node_id_lookup.py131 passed, 10 skipped;tests/sync_integration/sql/test_node_id_lookup.py131 passed, 10 skipped. The skips are the store-specific cases (each test says which store it's for).ruff format --check, pyright andunasync --checkare clean.Review: 2 passes, last CLEAN.