Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (29 sloc) 631 Bytes


Open a database

sqlite3 something.db

Show all tables


Show columns in a table

.schema tablename

Direct output to a file

.output somefile.txt

Export all columns as text

SELECT * FROM message;

Get help


Reclaim unused space




Export a table as SQL

.mode insert posts
.out posts.sql
select * from posts;

Repair a damaged db

sqlite3 development.sqlite3
sqlite> .output dump.sql
sqlite> .dump
sqlite> .quit

cat dump.sql | sqlite3 new.sqlite3