locksmith
v0.1.1Lints PostgreSQL migrations for dangerous locking operations and suggests safe rewrites.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
analyze_migration Analyze a SQL migration for locking hazards
Lint a PostgreSQL migration for operations that take dangerous locks (table rewrites, blocking index builds, validating constraints, destructive/breaking changes) and return a PASS/REVIEW/BLOCK verdict with per-statement findings and safe rewrites. Call this before applying or approving any migration.
| Parameter | Type | Description |
|---|---|---|
sql * | string | The full SQL migration script to analyze. |
assumeLargeTables | boolean | Assume target tables are large/hot, so scans and rewrites are flagged. Default true (fail safe). |
explain_lock Explain a PostgreSQL lock mode
Given a lock mode name (e.g. 'ACCESS EXCLUSIVE') or a fragment of an operation, explain what it blocks and which operations acquire it.
| Parameter | Type | Description |
|---|---|---|
query * | string | A lock mode name or operation fragment, e.g. 'ACCESS EXCLUSIVE' or 'create index'. |