Show Table structure:
Copy Code code as follows:
Get all tables and views:
Copy Code code as follows:
Gets the list of indexes for the specified table:
Copy Code code as follows:
To export a database to a SQL file:
Copy Code code as follows:
SQLite > output [filename]
SQLite > Dump
SQLite > Output stdout
To import a database from a SQL file:
Copy Code code as follows:
Format output data to CSV format:
Copy Code code as follows:
SQLite >.output [Filename.csv]
SQLite >.separator,
SQLite > select * from Test;
SQLite >.output stdout
To import data from a CSV file into a table:
Copy Code code as follows:
SQLite >create table newtable (ID integer primary key, value text);
SQLite >.import [Filename.csv] NewTable
Back up the database:
Copy Code code as follows:
/* Usage:sqlite3 [Database]. dump > [FileName] * *
Sqlite3 mytable.db. Dump > Backup.sql
To recover a database:
Copy Code code as follows:
/* Usage:sqlite3 [Database] < [filename] * *
Sqlite3 Mytable.db < Backup.sql