sqlite3 app.dbCreates the file if it does not exist and opens an interactive shell session.
sqlite3 shell commands for opening databases, inspecting schema, formatting output, importing CSV, and scripting common interactive workflows.
Start sqlite3, open files, inspect databases, and discover schema objects.
sqlite3 app.dbCreates the file if it does not exist and opens an interactive shell session.
sqlite3 :memory:Useful for quick experiments, demos, and throwaway SQL tests.
.databasesDisplays the database aliases and file paths known to the current connection.
.tablesFast way to discover tables and virtual tables from the shell.
.schemaGood for inspecting tables, indexes, triggers, and views.
.schema usersLimits output to matching objects, which is easier to read in larger databases.
.fullschemaHelpful when investigating query-planner behavior and generated internal objects.
.helpUseful when working on a new machine or less-familiar sqlite3 version.
Format results, run scripts, import CSV, and dump databases.
.headers onOften paired with `.mode column` for human-readable query results.
.mode columnGreat for interactive browsing in a terminal.
.mode csvUseful before redirecting or writing query output to a file.
.import ./users.csv usersMake sure the target table exists first or use a staging table for cleanup.
.read ./schema.sqlUseful for schema initialization, migrations, or repeatable demos.
.dumpHelpful for backups, migrations, and reproducible fixtures.
Send one result set to a file without changing subsequent output.
.once users.csvCombine with `.mode csv` and a `SELECT` statement to export a query result.
.recoverCan salvage data from a corrupt database into SQL output for rebuilding.