笔记_SQLite点命令

.archive ...        Manage SQL archives

.auth ON|OFF       Show authorizer callbacks
.backup ?DB? FILE    Backup DB (default "main") to FILE  备份 DB 数据库(默认是 "main")到 FILE 文件。
.bail on|off        Stop after hitting an error. Default OFF  发生错误后停止。默认为 OFF。
.binary on|off         Turn binary output on or off. Default OFF
.cd DIRECTORY     Change the working directory to DIRECTORY
.changes on|off       Show number of rows changed by SQL
.check GLOB       Fail if output since .testcase does not match
.clone NEWDB       Clone data into NEWDB from the existing database
.databases           List names and files of attached databases  列出数据库的名称及其所依附的文件。
.dbconfig ?op? ?val?      List or change sqlite3_db_config() options
.dbinfo ?DB?       Show status information about the database
.dump ?TABLE? ...    Render all database content as SQL  以 SQL 文本格式转储数据库。如果指定了 TABLE 表,则只转储匹配 LIKE 模式的 TABLE 表。
.echo on|off        Turn command echo on or off
.eqp on|off|full|...      Enable or disable automatic EXPLAIN QUERY PLAN
.excel          Display the output of next command in a spreadsheet
.exit ?CODE?         Exit this program with return-code CODE
.expert EXPERIMENTAL.   Suggest indexes for specified queries
.filectrl CMD ...       Run various sqlite3_file_control() operations
.fullschema ?--indent?      Show schema and the content of sqlite_stat tables
.headers on|off        Turn display of headers on or off 开启或关闭头部显示。
.help ?-all? ?PATTERN?     Show help text for PATTERN
.import FILE TABLE      Import data from FILE into TABLE  导入来自 FILE 文件的数据到 TABLE 表中。
.imposter INDEX TABLE      Create imposter table TABLE on index INDEX
.indexes ?TABLE?        Show names of indexes  显示所有索引的名称。如果指定了 TABLE 表,则只显示匹配 LIKE 模式的 TABLE 表的索引。
.limit ?LIMIT? ?VAL?        Display or change the value of an SQLITE_LIMIT
.lint OPTIONS        Report potential schema issues.
.load FILE ?ENTRY?      Load an extension library 加载一个扩展库。
.log FILE|off          Turn logging on or off. FILE can be stderr/stdout

设置输出模式,MODE 可以是下列之一:

            • csv 逗号分隔的值

            • column 左对齐的列

            • html HTML 的 <table> 代码

            • insert TABLE 表的 SQL 插入(insert)语句

            • line 每行一个值

            • list 由 .separator 字符串分隔的值

            • tabs 由 Tab 分隔的值

            • tcl TCL 列表元素

.mode MODE ?TABLE?      Set output mode
.nullvalue STRING      Use STRING in place of NULL values  在 NULL 值的地方输出 STRING 字符串。
.once (-e|-x|FILE)      Output for the next SQL command only to FILE
.open ?OPTIONS? ?FILE?      Close existing database and reopen FILE
.output ?FILE?      Send output to FILE or stdout if FILE is omitted  (? .output FILENAME?发送输出到 FILENAME 文件。)
.parameter CMD ...      Manage SQL parameter bindings
.print STRING...      Print literal STRING
.progress N     Invoke progress handler after every N opcodes
.prompt     MAIN CONTINUE Replace the standard prompts
.quit        Exit this program
.read FILE      Read input from FILE
.recover      Recover as much data as possible from corrupt db.
.restore ?DB?     FILE Restore content of DB (default "main") from FILE
.save FILE      Write in-memory database into FILE
.scanstats on|off      Turn sqlite3_stmt_scanstatus() metrics on or off
.schema ?PATTERN?      Show the CREATE statements matching PATTERN 得到表的完整信息

 


.selftest ?OPTIONS?      Run tests defined in the SELFTEST table
.separator COL ?ROW?      Change the column and row separators
.sha3sum ...      Compute a SHA3 hash of database content
.shell CMD ARGS...      Run CMD ARGS... in a system shell
.show          Show the current values for various settings显示各种设置的当前值。
.stats ?on|off?        Show stats or turn stats on or off
.system CMD ARGS...      Run CMD ARGS... in a system shell
.tables ?TABLE?      List names of tables matching LIKE pattern TABLE
.testcase       NAME Begin redirecting output to 'testcase-out.txt'
.testctrl CMD ...        Run various sqlite3_test_control() operations
.timeout MS        Try opening locked tables for MS milliseconds
.timer on|off       Turn SQL timer on or off
.trace ?OPTIONS?        Output each SQL statement as it is run
.vfsinfo ?AUX?       Information about the top-level VFS
.vfslist            List all available VFSes
.vfsname ?AUX?         Print the name of the VFS stack
.width NUM1 NUM2 ...      Set column widths for "column" mode

 

 

参考

1、https://www.runoob.com/sqlite/sqlite-commands.html

2、https://www.jianshu.com/p/424a8b143bbb

3、https://www.yiibai.com/sqlite/what-is-sqlite.html

posted @ 2019-07-16 20:17 aeron99 阅读(...) 评论(...) 编辑 收藏