
scythe inspect: find missing FK indexes, RLS-disabled tables, and duplicate indexes in your Postgres schema
I maintain scythe, an MIT SQL-to-typed-code generator (think sqlc, but for 10 languages), and one part of it turned out genuinely useful on its own for Postgres: scythe inspect.
It connects to a live database and flags operational issues that are easy to miss:
- Foreign keys with no covering index (the classic silent seq-scan on delete/join).
- Tables that have RLS policies defined but RLS not actually enabled.
- Duplicate indexes (same columns, same order) quietly taxing every write.
It reads your schema, not your app code, so it doesn't care which ORM or driver you use. Output is human-readable, or SARIF/JSON to wire into CI. Postgres-only for now (that's where I needed it first).
Repo: https://github.com/Goldziher/scythe (inspect docs under guide/inspect)
Two honest notes: the codegen side is inspired by sqlc, and inspect is young, so I'd like to hear which other checks are worth adding. What schema smells do you wish something caught automatically?