Hosting Operations
Read-onlyShow Indexes on a SQLite Table
You need to inspect indexes attached to one SQLite table.
Command
sqlite3 app.db "PRAGMA index_list('orders');"
Before you run this
System impact: Read-only. Low when scoped to the shown target.
When not to use it: Do not use it alone to prove an index is used; follow up with EXPLAIN QUERY PLAN.
Expected output
Index rows showing index name, uniqueness, origin, and partial-index flag.
System impact
Read-only. Nothing changes. SQLite prints index metadata for the table.
Recovery / rollback: no state is changed.
When to use it
Use before changing queries or adding indexes during performance triage.
When not to use it
Do not use it alone to prove an index is used; follow up with EXPLAIN QUERY PLAN.
next steps
Related commands
Count Rows in Key SQLite Tables
A quick row count can reveal empty imports, runaway events, or missing data.
sqlite3 app.db "SELECT 'users', count(*) FROM users UNION ALL SELECT 'orders', count(*) FROM orders UNION ALL SELECT 'events', count(*) FROM events;"
Show One SQLite Table Schema
A failed query is often just a wrong assumption about column names.
sqlite3 app.db ".schema users"
Check SQLite Database Integrity
When a SQLite-backed app behaves strangely, first rule out file corruption.
sqlite3 app.db "PRAGMA integrity_check;"
List SQLite User Tables Only
System metadata tables can distract from the app tables you care about.
sqlite3 app.db "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;"
Show Recent SQLite Events
For small apps, the quickest timeline may be inside the SQLite file.
sqlite3 app.db "SELECT created_at, event_type FROM events ORDER BY created_at DESC LIMIT 5;"
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.