Skip to content

Move to the Cypher compiler 0.56.0, and name a $-named CaseInsensitive property's lowercased copy as the lookup reads it (#615) - #620

Merged
jasperblues merged 6 commits into
mainfrom
fix/615-dollar-lower-copy
Dec 5, 2026
Merged

jasperblues merged 6 commits into
mainfrom
fix/615-dollar-lower-copy

Conversation

@jasperblues

Copy link
Copy Markdown
Member

Fixes #615

Moves drivine-python to the Cypher compiler 0.56.0 and its spec. It also makes this library's half of liberation-data/drivine-cypher-spec#355, whose module half, the Postgres write function, ships in 0.56.0.

The #355 fix

A property named with a leading $, such as Annotated[str, GraphProperty("$mail"), CaseInsensitive()], is held as $$mail on the SQL stores. Every lookup, and the ignore-case index, reads its lowercased copy under the user's name, __drivine.lower.$mail. Before this change the copy wasn't written there:

  • SQLite's writer wrote it under __drivine.lower.$$mail.
  • Oracle's lower_node was given the raw name, so it found no value and wrote no copy.
  • Each store's fill read the value at the user's name, found nothing, and wrote no copy.

Once an ignore-case index or constraint was ensured, eq_ignore_case on such a property found nothing, and a uniqueness constraint over it was never enforced.

What changes:

  • user_key sits beside held_key and undoes it.
  • SQLite's writer and Oracle's lower_node read the held key and name the copy for the user's name.
  • Each fill reads the value at the held key and writes lower_copies.of(property).
  • A store saved before this heals on each ensure. LowerCopyCatalog leaves a $-named property out of the record the schema planner reads, so every ensure fills its copy in again. The sync mirror follows.
  • Docs: docs/06 and the lower_copies.of docstring are updated.

The move to 0.56.0

  • Compiler: pinned to drivine-cypher-compiler==0.56.0 in every extra, and uv.lock changes only the compiler.
  • Spec: tests/cypher is the spec at v0.56.0 (scripts/sync_cypher_spec.py).
  • Golden statements: tests/golden is Drivine for TypeScript's at liberation-data/drivine@d193c87c, the merge of #921 (scripts/sync_golden.py).
  • The SQLite extension's host version is 3. HOST_VERSION in sqlite_extension.py is now 3, or the load check would refuse the 0.56.0 extension. Its unit test follows.
  • Postgres skips removed: the UNMERGED_539 skips are gone from the dollar-named tests, since 0.56.0 carries drivine-cypher-spec#539.
  • A hold for \R: steps 6 and 17 of "A regular expression's escapes and classes", new in v0.56.0, use \R, which the native SQLite extension refuses (drivine-cypher-spec#352). They're held on SQLite in HELD, so each is checked to fail as it does until the extension answers it.

Checks

The whole suite ran through the lock:

  • uv run pytest -q, on Postgres, SQLite, Neo4j, Memgraph and FalkorDB: 10,675 passed, 835 skipped, 0 failed.
  • ORACLE_TESTS=true uv run pytest -q -k oracle: 3,151 passed, 130 skipped, 0 failed.

The container-free checks pass too: ruff, ruff format, pyright, the unasync check, and 3,258 unit tests.

Flagged, filed separately:

Review: 2 passes on the #355 port, last CLEAN; 1 pass on the repin, the hold and the test ids, CLEAN

…r's name on SQLite and Oracle, read it where the node holds it in each fill, and fill it in again on each ensure (drivine-cypher-spec#355)
…functions' version 3, and the golden statements Drivine for TypeScript writes with it

The compiler names a dollar-named property's lowercased copy on Postgres too (drivine-cypher-spec#539), so the two
dollar-named tests that skipped Postgres run there.
…52, and give the dollar-named uniqueness test ids of its own

The native SQLite extension refuses \R, which steps 6 and 17 of "A regular expression's escapes and classes" use.
The uniqueness test's u1 was found, by id alone, by the patch test's look at what the store holds.
@jasperblues
jasperblues merged commit 30073a6 into main Dec 5, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant