一些有用的 SQLite 命令

前端之家收集整理的这篇文章主要介绍了一些有用的 SQLite 命令前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

http://www.oschina.net/question/12_53183


显示表结构: sqlite> .schema [table] 获取所有表和视图: sqlite > .tables 获取指定表的索引列表: sqlite > .indices [table ] 导出数据库sql 文件sqlite > .output [filename ] sqlite > .dump sqlite > .output stdout 从 sql 文件导入数据库sqlite > .read [filename ] 格式化输出数据到 CSV 格式: sqlite >.output [filename.csv ] sqlite >.separator,sqlite > select * from test; sqlite >.output stdout 从 CSV 文件导入数据到表中: sqlite >create table newtable ( id integer primary key,value text ); sqlite >.import [filename.csv ] newtable 备份数据库: /* usage: sqlite3 [database] .dump > [filename] */ sqlite3 mytable.db .dump > backup.sql 恢复数据库: /* usage: sqlite3 [database ] < [filename ] */ sqlite3 mytable.db < backup.sql

猜你在找的Sqlite相关文章