久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術文章
文章詳情頁

一些很有用的SQLite命令總結

瀏覽:255日期:2023-04-05 14:55:57

顯示表結構:
復制代碼 代碼如下:
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
相關文章:
主站蜘蛛池模板: 旬邑县| 株洲市| 湘潭县| 阳曲县| 兰州市| 剑川县| 洪江市| 大石桥市| 万安县| 车致| 福清市| 云南省| 延寿县| 新巴尔虎左旗| 晋江市| 卓尼县| 会东县| 龙江县| 东莞市| 昭平县| 繁峙县| 射洪县| 宁明县| 永德县| 沧源| 永善县| 卢龙县| 吉安县| 福泉市| 堆龙德庆县| 南昌县| 敦化市| 南和县| 宁波市| 麦盖提县| 财经| 全椒县| 泽州县| 岳阳县| 灵台县| 渭南市|