The test database that lied · figure 2

Same tests, new judge

The suite still executes on SQLite. What changed is who gets to rule on the lock shape.

before one path — the lock shape is never checked

lock statementcarries FOR UPDATE intent
with_for_update_if_supportedon SQLite — strips FOR UPDATE
execute on SQLite
green — lock shape never checked

after the same statement forks — execution unchanged, shape judged by Postgres

lock statementthe same statement
unchanged
with_for_update_if_supportedon SQLite — strips FOR UPDATE
execute on SQLite
new
assert_pg_lock_compatible monkeypatch get_dialect_name"postgresql"
compile against postgresql.dialect()
build fails if FOR UPDATE is combined with aggregateGROUP BYHAVINGDISTINCTset operationwindow function
Tests still run on SQLite — but the lock shape is now judged by the compiler for the database that actually enforces it.