SQLite/Release3
< SQLite
Before reading this you're supposed to have downloaded and unpacked in your PATH the latest version of the executable command line interface sqlite3 for your operating system.
CommandLine
editUsage: sqlite3 [OPTIONS] FILENAME [SQL]
- FILENAME is the name of an SQLite database. A new database is created if the file does not previously exist.
- SQL is a dot-, SQL-command or Pragma. OPTIONS include:
-A ARGS... = .archive ARGS and exit -append append database to end of file -ascii = .mode ascii -bail = .bail on -batch force batch I/O -box = .mode box -column = .mode column -cmd COMMAND run "COMMAND" before reading stdin -csv = .mode csv -deserialize open using sqlite3_deserialize() -echo = .echo on -init FILENAME read/process named file -[no]header = .header [off] or on -help show this message -html = .mode HTML -interactive force interactive I/O -json = .mode json -line = .mode line |
-list = .mode list -lookaside SIZE N use N entries of SIZE bytes for lookaside memory -markdown = .mode markdown -memtrace trace all memory allocations and (de)allocations -mmap N default mmap size set to N -newline SEP = .separator "|" SEP. Default: "\n" -nofollow = refuse to open symbolic links to database files -nullvalue TEXT = .NULLvalue TEXT. Default "" -pagecache SIZE N use N slots of SIZE bytes each for page cache memory -quote = .mode quote -readonly open the database read-only -separator SEP = .separator SEP. Default: "|" -stats print memory stats before each finalize -table = .mode table -tabs = .mode tabs -version = .version -vfs NAME use NAME as the default VFS -zip open the file as a ZIP Archive |
DotCommands
edit
|
|
|
- D-notes
More info @sqlite.org/cli.html#special_commands_to_sqlite3_dot_commands_
a .ar [OPTION...] [FILE...] The .ar command manages sqlar archives. Examples: .ar -cf archive.sar foo bar # Create archive.sar from files foo and bar .ar -tf archive.sar # List members of archive.sar .ar -xvf archive.sar # Verbosely extract files from archive.sar Each command line must feature exactly one command option: -c, --create Create a new archive -u, --update Update or add files to an existing archive -t, --list List contents of archive -x, --extract Extract files from archive And zero or more optional options: -v, --verbose Print each filename as it is processed -f FILE, --file FILE Operate on archive FILE (default is current db) -a FILE, --append FILE Operate on FILE opened using the apndvfs VFS -C DIR, --directory DIR Change to directory DIR to read/extract files -n, --dryrun Show the SQL that would have occurred See also: sar-support e or invoke system text editor (-e) or spreadsheet (-x) on the output. |
|
KeyWords
editIf one wants to use one of following words as an identifier the word needs to be enclosed in two double quotes '"', backquotes '`' or '[' and ']'.[1]
|
|
|
|
|
|
|
|
- K-notes and/or references
- ↑ SQLite Keywords more info @sqlite.org/lang_keywords.html.
- ↑ a b Not a keyword, but a predefined variable. Usage as identifier might be confusing.
Pragmas
editPragmas are special commands to show or [change] behavior of open database[schema](s)
- Usage: PRAGMA [schema-name.]name [ = TEXT or INT ];
- active pragmas (61)
|
|
|
|
|
|
- deprecated pragmas (7)
|
|
|
|
- pragmas with non-standard compile-options (5)
|
|
|
|
|
- More info: List Of PRAGMAs @SQLite.org