Skip to content

mountsqli analyze

mountsqli analyze compares your code-defined schema against the live database and reports actionable health information. Run it in CI or before a release.

Terminal window
mountsqli analyze
Section What it checks
Drift code schema vs live DB (introspect diff)
Index suggestions columns used in filters/joins without an index
Plan warnings queries that scan full tables or miss constraints
$ mountsqli analyze
Drift: none
Indexes: suggest INDEX on "orders"("customerId")
Plans: "users".where("email" = ?) — add UNIQUE on email
flowchart LR
  A[code TableDef[]] --> B[diffSchemas vs live]
  C[live DB via introspect] --> B
  B --> D[Drift report]
  E[QueryPlans] --> F[suggestIndexes]
  F --> G[Index suggestions]
  • Run analyze in CI to fail on drift before deploy.
  • Apply suggested indexes after confirming query patterns.
  • Re-run after schema changes to keep suggestions fresh.
  • Ignoring drift warnings — they mean code and DB disagree.
  • Adding every suggested index blindly — measure first.