Throughout initialization, any previously INIT FILE sqlite3 reads an initialization file to set the configuration of the stats Print memory stats before each finalize. Set string used to represent NULL values. Set default mmap size to N -nullvalue string list Query results will be displayed with the separator (|, byĭefault) character between each field value. line Query results will be displayed with one value per line, rows html Query results will be output as simple HTML tables. Read and execute commands from file, which can contain a mix of csv Set output mode to CSV (comma separated values). Whitespace characters to separate the columns and align the Query results will be displayed in a table like form, using OPTIONS sqlite3 has the following options: vfsname ?AUX? Print the name of the VFS stack trace FILE|off Output each SQL statement as it is run timeout MS Try opening locked tables for MS milliseconds If TABLE specified, only list tables matching show Show the current values for various settings separator STRING ?NL? Change separator used by output mode and. If TABLE specified, only show tables matching schema ?TABLE? Show the CREATE statements save FILE Write in-memory database into FILE restore ?DB? FILE Restore content of DB (default "main") from FILE prompt MAIN CONTINUE Replace the standard prompts output ?FILENAME? Send output to FILENAME or stdout open ?FILENAME? Close existing database and reopen FILENAME once FILENAME Output for the next SQL command only to FILENAME nullvalue STRING Use STRING in place of NULL values mode MODE ?TABLE? Set output mode where MODE is one of:Ĭolumn Left-aligned columns. load FILE ?ENTRY? Load an extension library If TABLE specified, only show indices for tables indices ?TABLE? Show names of all indices import FILE TABLE Import data from FILE into TABLE headers on|off Turn display of headers on or off fullschema Show schema and the content of sqlite_stat tables explain ?on|off? Turn output mode suitable for EXPLAIN on or off. eqp on|off Enable or disable automatic EXPLAIN QUERY PLAN If TABLE specified, only dump tables matching databases List names and files of attached databases clone NEWDB Clone data into NEWDB from the existing database bail on|off Stop after hitting an error. backup ?DB? FILE Backup DB (default "main") to FILE Meta-commands are alwaysĪ list of available meta-commands can be viewed at any time by issuing Used to control the output format, examine the currently attachedĭatabase files, or perform administrative operations upon the attachedĭatabases (such as rebuilding indices). The interactive interpreter offers a set of meta-commands that can be $ sqlite3 -line mydata.db 'select * from memos where priority > 20 ' Multiple statements should be separated by semi. Optionally, a SQL statement or set of SQL statements can be supplied asĪ single argument. This is useful for migrating data between databases, possibly Used to attach to multiple databases within the same interactive If no database name is supplied, the ATTACH sql command can be used toĪttach to existing or create new database files. Sqlite> insert into memos values('lunch with Christine', 100) Sqlite> insert into memos values('deliver project description', 10) Sqlite> create table memos(text, priority INTEGER) Table named "memos" and insert a couple of records into that table: If the database file does exist,įor example, to create a new database file named "mydata.db", create a If the database fileĭoes not exist, it will be created. Optionally provide the name of a database file. To start a sqlite3 interactive session, invoke the sqlite3 command and sqlite3 can also be used within shell scripts and otherĪpplications to provide batch processing features. SUMMARY sqlite3 is a terminal-based front-end to the SQLite library that canĮvaluate queries interactively and display the results in multipleįormats. NAME sqlite3 - A command line interface for SQLite version 3
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |