標籤:
命令:
舉例
輸出協助資訊sqlite>.help
(注意命令前帶字元‘.‘):
查看資料庫檔案資訊命令:sqlite>.database
查看所有表的建立語句:sqlite>.schema
查看指定表的建立語句:sqlite>.schema table_name
sqlite> .schema
CREATE TABLE mytable(id integer primary key,value text);CREATE TABLE tbl1(one varchar(10),two smallint, email text ‘‘ collate nocase, others text ‘‘);CREATE INDEX test_idx on tbl1(two);CREATE VIEW tbl1view as select * from tbl1;CREATE TABLE t_table1(name text,age interger, num);CREATE INDEX t_table1_index on t_table1(name);
以sql語句的形式列出表內容:sqlite>.dump table_name
設定顯示資訊的分隔字元:sqlite>.separator symble
Example:設定顯示資訊以‘:’分隔sqlite>.separator :
設定顯示模式:sqlite>.mode mode_name
Example:預設為list,設定為column,其他模式可通過.help查看mode相關內容sqlite>.mode columnsqlite> select * from t_table1;name age num-------- ---------- ----------xinxin 8 1wangwu 20lisi 20libai 200
設定每一列的顯示寬度:sqlite>.width width_value
Example:設定寬度為2sqlite>.width 2
列出當前顯示格式的配置:sqlite>.show
sqlite> .show echo: off explain: off headers: on mode: columnnullvalue: "" output: stdoutseparator: "|" stats: on width:
退出sqlite終端命令:sqlite>.quit或sqlite>.exit
sqlite-命令(如.help)