Sqlite3 Cheat Sheet: by Via
Sqlite3 Cheat Sheet: by Via
Sqlite3 Cheat Sheet: by Via
Backup DB (default "main") to FILE Send output to the screen Read and execute commands from file ,
which can contain a mix of SQL statements
.bail ON|OFF .prompt MAIN CONTINUE
and meta-commands.
Stop after hitting an error. Default OFF Replace the standard prompts
-echo
.databases .quit
Print commands before execution.
List names and files of attached databases Exit this program
-[no]header
.dump ?TABLE? ... .read FILENAME
Turn headers on or off.
Dump the database in an SQL text format. Execute SQL in FILENAME
-bail
.echo ON|OFF .restore ?DB? FILE
Stop after hitting an error.
Turn command echo on or off Restore content of DB (default "main") from
FILE -interactive
.exit
Force interactive I/O .
Exit this program
sqlite3 Meta Commands contd. -batch
.explain ?ON|OFF?
.schema ?TABLE? Force batch I/O .
Turn output mode suitable for EXPLAIN on
Show the CREATE statements -column
or off.
.separator STRING Query results will be displayed in a table like
.header(s) ON|OFF
form, using whitespace characters to
Change separator used by output mode and
Turn display of headers on or off separate the columns and align the output.
.import
.help -csv
.show
Shows this information. Set output mode to CSV (comma separated
Show the current values for various settings
.import FILE TABLE values).
.stats ON|OFF
Import data from FILE into TABLE -html
Turn stats on or off
.indices ?TABLE? Query results will be output as simple HTML
.tables ?TABLE? tables.
Show names of all indices
List names of tables -line
.load FILE ?ENTRY?
.timeout MS Query results will be displayed with one
Load an extension library
Try opening locked tables for MS value per line, rows separated by a blank
.log FILE|off milliseconds line. Designed to be easily parsed by scripts
or other programs
Turn logging on or off. FILE can be
.width NUM1 NUM2 ...
stderr/stdout -list
Set column widths for "column" mode
.mode MODE ?TABLE? Query results will be displayed with the
.timer ON|OFF
Set output mode where MODE is one of: separator (|, by default) character between
Turn the CPU timer measurement on or off each field value. The default.
csv, column, html, insert, line, list, tabs, tcl
-separator separator
.nullvalue STRING
sqlite3 See Also
Set output field separator. Default is '|'.
Print STRING in place of NULL values
http://www.sqlite.org/
.output FILENAME The sqlite3-doc package.
Send output to FILENAME
-stats
-nullvalue string
-version
-vfs name
-help