Skip to content

Commit e5ad595

Browse files
Pin SQLAlchemy compliance baseline for rowcount, lastrowid, empty inserts
The Requirements class already documents a block of "baseline declarations mirroring SQLite behavior" so a future maintainer running the SQLAlchemy compliance suite has a single source of truth. Four flags that match the same pattern were missed: sane_rowcount, sane_multi_rowcount, emulated_lastrowid, supports_empty_inserts. All four hold for dqlite today — the server forwards ResultResponse.rows_affected / last_insert_id verbatim, executemany aggregates per-iteration rowcounts, and INSERT ... DEFAULT VALUES is regular SQLite syntax. Pin them open() alongside the others and extend the exclusion-object test to cover the new names. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 88fcc3d commit e5ad595

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

src/sqlalchemydqlite/requirements.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,26 @@ def temporary_tables(self) -> Any:
114114
def table_ddl_if_exists(self) -> Any:
115115
"""CREATE TABLE IF NOT EXISTS / DROP TABLE IF EXISTS."""
116116
return exclusions.open()
117+
118+
@property
119+
def sane_rowcount(self) -> Any:
120+
"""UPDATE / DELETE rowcount is truthful. dqlite forwards the server's
121+
sqlite3_changes() verbatim via ResultResponse.rows_affected."""
122+
return exclusions.open()
123+
124+
@property
125+
def sane_multi_rowcount(self) -> Any:
126+
"""executemany aggregates each iteration's rowcount, so multi-row
127+
UPDATE / DELETE totals match the caller's expectation."""
128+
return exclusions.open()
129+
130+
@property
131+
def emulated_lastrowid(self) -> Any:
132+
"""lastrowid is SQLite's ROWID, forwarded verbatim via
133+
ResultResponse.last_insert_id."""
134+
return exclusions.open()
135+
136+
@property
137+
def supports_empty_inserts(self) -> Any:
138+
"""INSERT INTO t DEFAULT VALUES. SQLite supports it; dqlite inherits."""
139+
return exclusions.open()

tests/test_requirements.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ def test_properties_return_exclusion_objects(self) -> None:
1515
"savepoints",
1616
"two_phase_transactions",
1717
"temp_table_reflection",
18+
"sane_rowcount",
19+
"sane_multi_rowcount",
20+
"emulated_lastrowid",
21+
"supports_empty_inserts",
1822
]
1923
for prop_name in properties:
2024
value = getattr(req, prop_name)

0 commit comments

Comments
 (0)