Information Technology Reference
In-Depth Information
SQLite special commands
Once you connect to a database, there are a number of built-in SQLite commands known as
dot commands that can be used to obtain information from the database files. You can ob-
tain the list of special commands by issuing the .help command in the SQLite prompt.
These are SQLite-specific commands and do not require a semicolon at the end of the com-
mand. Most commonly used dot commands include the following:
.tables : This lists all of the tables within a database. The following example
displays the list of tables found inside the sms.db database:
sqlite> .tables
_SqliteDatabaseProperties chat_message_join
attachment handle
chat message
chat_handle_join message_attachment_join
.schema table-name : This displays the SQL CREATE statement used to con-
struct the table. The following example displays the schema for the handle table,
which is found inside the sms.db database:
sqlite> .schema handle
CREATE TABLE handle ( ROWID INTEGER PRIMARY KEY
AUTOINCREMENT UNIQUE, id TEXT NOT NULL, country TEXT,
service TEXT NOT NULL, uncanonicalized_id TEXT, UNIQUE
(id,service) );
.dump table-name : This dumps the entire content of a table into SQL state-
ments. The following example displays the dump of the handle table, which is
found inside the sms.db database:
sqlite> .dump handle
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE handle ( ROWID INTEGER PRIMARY KEY
AUTOINCREMENT UNIQUE, id TEXT NOT NULL, country TEXT,
service TEXT NOT NULL, uncanonicalized_id TEXT, UNIQUE
(id,service) );
INSERT INTO "handle"
Search WWH ::




Custom Search