出于某种原因,我无法找到与sqlite的交互式shell命令等效的方法:
.tables
.dump
使用Python sqlite3API.
有这样的事吗?
出于某种原因,我无法找到与sqlite的交互式shell命令等效的方法:
.tables
.dump
使用Python sqlite3API.
有这样的事吗?
您可以通过查询SQLITE_MASTER表来获取表和模式的列表:
sqlite> .tab
job snmptarget t1 t2 t3
sqlite> select name from sqlite_master where type = 'table';
job
t1
t2
snmptarget
t3
sqlite> .schema job
CREATE TABLE job (
id INTEGER PRIMARY KEY,
data VARCHAR
);
sqlite> select sql from sqlite_master where type = 'table' and name = 'job';
CREATE TABLE job (
id INTEGER PRIMARY KEY,
data VARCHAR
)