Aftermarket Adds AfterSchema to Keep Old SQL Working After a Schema Change
Aftermarket 0.8.0 adds AfterSchema, for the reports, scripts and dashboards that still read an app’s SQLite database after it moved to a new schema. You describe each old table in terms of the new ones, and AfterSchema writes views that show the old tables again. schema diff marks what breaks old readers, schema check compiles the old queries against the new schema, and schema test runs every old read on both databases and compares the rows exactly. It never writes a database; the views go to a .sql file you review and apply.
In the case study, 1 of a shop’s 12 old reports compiles on its 2.0 schema, and all 12 read the same through the views. The test also catches a customer’s lost fax number and a mapping that forgot totals moved to cents.
AfterSchema works through the sqlite3 program, so the work before release went into making sure no SQL handed to it can make that shell run one of its own commands. It took three independent reviews, the last of which compared the check with SQLite’s own rules on 2.1 million cases and found no way through. The suite now has 506 tests. Between 0.7.0 and this, the 0.7.1 and 0.7.2 patch releases fixed proxy answers cut off under load and stalled or cut-off uploads. Binaries are out for Linux, macOS and Windows. The previous note covers TOML in AfterConfig.