SQLite learning notes (11) command line tool

Source: Internet
Author: User
<SPAN
style="COLOR: #ff0000">sqlite> .help
</SPAN>.backup ?DB?
FILEBackup
DB (default
"main") to FILE.bail ON|OFF
Stop after hitting an error.  Default OFF.databases             List names
and files of attached databases
.dump ?TABLE? ...      Dump the database
in an SQL
text format                          If
TABLE specified, only dump tables matching
                         LIKE
pattern TABLE.
.echo ON|OFF
Turn command echo on or
off .exit                  Exit this program
.explain ?ON|OFF?      Turn output mode suitable
for EXPLAIN
on or
off.
                         With no args, it turns
EXPLAIN on. .header(s)
ON|OFF
Turn display of headers on or
off .help                  Show this message
.import FILE
TABLEImport data from
FILE into
TABLE.indices ?TABLE?       Show names of all indices
                         If
TABLE specified, only show indices
for tables                          matching
LIKE pattern
TABLE. .load FILE
?ENTRY?     Load an extension library
.log FILE|off          Turn logging on
or off. 
FILE can be stderr/stdout
.mode MODE
?TABLE?     Set output mode where
MODE is one of:
                         csv      Comma-separated values
                         column   Left-aligned columns.  (See .width)
                         html    
HTML <table> code
                         insert  
SQL insert statements
for TABLE                         line     One value per line
                         list     Values delimited by .separator string
                         tabs     Tab-separated values
                         tcl     
TCL list elements
.nullvalue
STRINGPrint
STRING in
place of
NULL
values
.output FILENAME
Send output to FILENAME.output stdout         Send output to the screen
.prompt MAIN
CONTINUEReplace the standard prompts
.quit                  Exit this program
.read FILENAME
Execute SQL
in
FILENAME.restore ?DB?
FILERestore content of
DB (default
"main") from FILE.schema ?TABLE?        Show the
CREATE statements
                         If
TABLE specified, only show tables matching
                         LIKE
pattern TABLE.
.separator
STRINGChange separator used by output mode
and .import .show                  Show the current values
for various settings
.stats ON|OFF
Turn stats on or
off .tables ?TABLE?        List names of tables
                         If
TABLE specified, only list tables matching
                         LIKE
pattern TABLE.
.timeout
MSTry opening locked tables
for MS
milliseconds .width NUM1
NUM2 ...   Set column widths
for "column"
mode .timer ON|OFF
Turn the CPU
timer measurement on
or
off

 

Command name Command description
. Help List all built-in commands.
. Backup dbname File Back up a specified database to a specified file. The default value is the currently connected main database.
. Databases Lists all the attached database names and file names in the current connection.
. Dump tablename... Dump is currently connected to the main database in SQL text format. If the table name is specified, it is only a data table that matches the dump and table name. The tablename parameter supports wildcards supported by the like expression.
. Echo on | off Turn on or off the display output.
. Exit Exit the current program.
. Explain on | off Enable or disable the select output of the current connection in the form of human readable.
. Header (s) on | off Whether to display the column title when the select result is displayed.
. Import file table Import the data of the specified file to the specified table.
. Indices tablename Display the names of all indexes. If the table name is specified, only the indexes of the data tables matching the table name are displayed. The tablename parameter supports wildcards supported by the like expression.
. Log File | off Enable or disable the log function. file can output stdout for standard output or stderr for standard error output.
. Mode mode tablename Set the output mode. The most common mode is column mode, which enables the select output column to be left aligned.
. Nullvalue string Use the specified string to display the null value.
. Output Filename Redirects all output of the current command to the specified file.
. Output stdout Redirects all output of the current command to the standard output (screen ).
. Quit Exit the current program.
. Read filename Execute the SQL statement in the specified file.
. Restore dbname File Restore the database from the specified file. The default value is the main database. You can also specify other database names. The specified database becomes the currently connected attached database.
. Schema tablename The table creation statement is displayed. If the table name is specified, only the table creation statements matching the table name are displayed. The tablename parameter supports wildcards supported by the like expression.
. Separator string Change the delimiter between output mode and. Import fields.
. Show Displays the current values of various settings.
. Tables tablename Lists all the table names of the main database in the current connection. If the table name is specified, only the table names matching the table name are displayed. The tablename parameter supports wildcards supported by the like expression.
. Width num1 num2... When mode is column, set the width of each field. Note: The Parameter order of this command indicates the field output order.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.