miiigrate 0.1.0
Initial release of miiigrate — forward-only SQL migrations for iii, driven entirely through the database worker (no direct database connection), plus TypeScript codegen of your schema.
Highlights
migrate::up— each migration runs as one atomicdatabase::transactionbatch:pg_advisory_xact_lockserialization on Postgres,BEGIN IMMEDIATEon SQLite. Concurrent migrators (e.g. multiple replicas withauto: true) are detected and counted as skips, not failures. Checksum drift on an applied file blocks the run (CHECKSUM_MISMATCH) before anything is applied.migrate::status— read-only report: applied / pending / mismatched / missing.migrate::create— UTC-timestamped scaffold with a forward-only header.migrate::codegen— Postgres (full: enums, arrays) and SQLite (basic) → TypeScript. Types describe values as they actually crossdatabase::query(JSON): timestamps are RFC 3339 strings, binary is base64.- SQL splitter aware of
'strings',E'…'escapes,"identifiers",$tag$…$tag$dollar quoting, and nested comments. - Checksums SHA-256 with CRLF→LF normalization — a Windows line-ending rewrite is not drift.
- Playgrounds: SQLite end-to-end scenario and a Postgres 16 two-instance concurrency proof (docker compose).
Requires
The database worker (iii worker add database). Postgres and SQLite in v1; MySQL is rejected with UNSUPPORTED_DIALECT.
Install
iii worker add miiigrateBinaries below cover linux x64/arm64 and macOS arm64/x64 (tar.gz + sha256).