All rules Rule SL015 · LK
SQLite · alpha
warning
LK · Locks & blocking
free in the CLI — --engine=sqlite

REINDEX of everything

Warning — it works, but holds the single write lock or breaks the previous release.

What it catches

REINDEX with no argument rebuilds every index in every attached database in one write transaction — the write lock is held for the total, not per table. In a migration it is almost always broader than intended.

Fires on

REINDEX;

Do this instead

Name the index or table that actually needs rebuilding — REINDEX is only needed after a collation change.

REINDEX orders_status_idx;
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