sqlite> .dump websties
BEGIN TRANSACTION;
COMMIT;
sqlite> .dump websites
BEGIN TRANSACTION;
CREATE TABLE [websites] (
[WebID] INTEGER NOT NULL PRIMARY KEY,
[WebName] VARCHAR(20) NULL
);
INSERT INTO "websites" VALUES(1,'Ctochina.net');
INSERT INTO "websites" VALUES(2,'搜狐');
INSERT INTO "websites" VALUES(3,'雅虎');
COMMIT;
sqlite>
BEGIN TRANSACTION;
COMMIT;
sqlite> .dump websites
BEGIN TRANSACTION;
CREATE TABLE [websites] (
[WebID] INTEGER NOT NULL PRIMARY KEY,
[WebName] VARCHAR(20) NULL
);
INSERT INTO "websites" VALUES(1,'Ctochina.net');
INSERT INTO "websites" VALUES(2,'搜狐');
INSERT INTO "websites" VALUES(3,'雅虎');
COMMIT;
sqlite>
sqlite> .echo on
sqlite> select * from websites;
select * from websites;
1|Ctochina.net
2|搜狐
3|雅虎
sqlite>
可以看出"select * from websites;"在和查询结果一起显示在屏幕上。sqlite> select * from websites;
select * from websites;
1|Ctochina.net
2|搜狐
3|雅虎
sqlite>
隐藏命令如:
".explain"命令可以被用来设置输出格式为“column” 并设置列宽为EXPLAIN命令看起来比较合理的宽度。EXPLAIN命令是sqlite特有的sql扩展,它是对调试有用。如果任何常规的sql被EXPLAIN执行,那么sql命令被分解并分析但并不执行。取而代之的是,虚拟机指令序列将被用于执行sql命令并返回一个类似的查询结果。可结合.width命令查看效果如:
sqlite> .explain
sqlite> select * from websites;
WebI WebName
---- -------------
1 Ctochina.net
2 搜狐
3 雅虎
sqlite>
用.width设置宽度再看效果
sqlite> select * from websites;
WebI WebName
---- -------------
1 Ctochina.net
2 搜狐
3 雅虎
sqlite>