Skip to content

v0.2.5 — the swap route's W1–W5, closed

Choose a tag to compare

@punnerud punnerud released this 02 Aug 15:03
· 124 commits to main since this release

Verified on Linux x86-64, macOS/Apple Silicon and Windows x86-64 — tests, clippy and the crash harnesses green on all three. Prebuilt binaries attached (CLI for all three platforms + the sqlite3 drop-in shim; sha256sums below).

The swap route's third field report, closed (W1–W5)

With v0.2.4, the Django 4.2 project driving this series got a full migrate through (238 tables, 571 indexes) and real test execution — behind five workarounds. This release closes their sources, so the workarounds can be deleted:

  • W1 — cursor chaining: Cursor.execute()/executemany() return the cursor (the stdlib contract). Django chains cursor.execute(...).fetchone() on a raw cursor in its query-logging path, unshimmable from above.
  • W2 — sqlite_master queries: the WHERE parser takes conditions split across lines (Django's json-field introspection writes one per line), and bare ? placeholders consume positions — two or more bound parameters used to silently answer zero rows.
  • W3 — PRAGMA index_list / index_info answer from the schema, including sqlite's sqlite_autoindex_… naming for unnamed constraint indexes (origin u, partial flag). This is the walk Django's get_constraints is built on; empty answers made every constraint invisible and killed AlterUniqueTogether migrations.
  • W4 — faithful sql text: the reconstructed CREATE TABLE keeps composite UNIQUE (…) clauses and marks AUTOINCREMENT; a named index's sqlite_master row carries its CREATE INDEX text (autoindexes stay NULL, sqlite's own shape).
  • W5 — mortal shared memory: file:…?mode=memory&cache=shared databases are now scoped to the process and their backing files removed at interpreter exit — sqlite's shared cache dies with the process; ours outlived it, so the next test run inherited a half-migrated store, and 64 MiB per name leaked in /dev/shm.

The report's leftover item (BEGIN after autocommit DML on a default connection) is pinned as stock-identical: measured side by side, the stdlib raises the same OperationalError.

Attached binaries

file contents
mpedb-0.2.5-linux-x86_64.tar.gz mpedb CLI, Linux x86-64
mpedb-0.2.5-macos-arm64.tar.gz mpedb CLI, macOS Apple Silicon
mpedb-0.2.5-windows-x86_64.zip mpedb.exe, Windows x86-64
libmpedb_sqlite3-0.2.5-linux-x86_64.tar.gz sqlite3 drop-in shim, Linux
libmpedb_sqlite3-0.2.5-macos-arm64.tar.gz sqlite3 drop-in shim, macOS
SHA256SUMS checksums for everything above