This section covers the sqlite3
dot-commands. Dot-commands control the mode and configuration of the
sqlite3 utility and, in some cases,
the underlying SQLite library. Normally, any input to the sqlite3 utility is assumed to be an SQL
statement and is passed to the SQLite library for processing. To distinguish
these commands from SQL statements, all of the dot-commands start with a
period, or “dot.” Hence, the name.
Unlike SQL statements, dot-commands do not end in a semicolon. The whole command must be given on a single line of input.
It is important to understand that the dot-commands
are implemented by the sqlite3 program
itself, and not the underlying SQLite library. Dot-commands cannot be issued
to the SQLite statement APIs.
For example, the core SQLite library has no import
capability. The functionality of the .import command is provided by the sqlite3 code, using the standard SQLite API calls. If you
want to include an import function in your application, you can either write
your own, using the standard SQLite API calls, or you can rip the code out
of shell.c and attempt to adapt it for
your own purposes.
Several of the dot-commands turn configuration flags
on or off. If a number is given, 0 is
false, or off, and all other numbers are taken to be true, or on. The
strings on and yes are recognized to be true, or on, and all other values
are taken to be false, or off.