All rules Rule SL026 · TX
SQLite · alpha
critical
TX · Transactions
free in the CLI — --engine=sqlite

BEGIN inside a transaction, or COMMIT without one

Critical — SQLite refuses the statement, so the migration fails here.

What it catches

SQLite has no nested transactions: a second BEGIN fails with "cannot start a transaction within a transaction", and COMMIT or ROLLBACK with nothing open fails with "no transaction is active". Either error stops the migration where it happens — usually because a runner already wraps the file.

Fires on

BEGIN;
BEGIN;
ALTER TABLE orders ADD COLUMN region TEXT;
COMMIT;

Do this instead

One BEGIN, one COMMIT, in order — or none at all if the migration runner manages the transaction. Use SAVEPOINT for a nested scope.

BEGIN;
ALTER TABLE orders ADD COLUMN region TEXT;
COMMIT;
Catch this before it ships

SQLite support is in alpha: this rule runs locally in the free CLI, static only, and not in the hosted service yet: npx bolvrk check migration.sql --engine=sqlite