{
    "mode": "man",
    "parameter": "SQLITE3",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/SQLITE3/1/json",
    "generated": "2026-09-03T22:57:10Z",
    "synopsis": "sqlite3 [options] [databasefile] [SQL]",
    "sections": {
        "NAME": {
            "content": "sqlite3 - A command line interface for SQLite version 3\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "sqlite3 [options] [databasefile] [SQL]\n\n",
            "subsections": []
        },
        "SUMMARY": {
            "content": "sqlite3  is a terminal-based front-end to the SQLite library that can evaluate queries inter‐\nactively and display the results in multiple formats.  sqlite3 can also be used within  shell\nscripts and other applications to provide batch processing features.\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "To start a sqlite3 interactive session, invoke the sqlite3 command and optionally provide the\nname  of  a  database file.  If the database file does not exist, it will be created.  If the\ndatabase file does exist, it will be opened.\n\nFor example, to create a new database file named \"mydata.db\", create a  table  named  \"memos\"\nand insert a couple of records into that table:\n\n$ sqlite3 mydata.db\nSQLite version 3.43.0 2023-08-11 17:45:23\nEnter \".help\" for usage hints.\nsqlite> create table memos(text, priority INTEGER);\nsqlite> insert into memos values('deliver project description', 10);\nsqlite> insert into memos values('lunch with Christine', 100);\nsqlite> select * from memos;\ndeliver project description|10\nlunch with Christine|100\nsqlite>\n\n\nIf  no database name is supplied, the ATTACH sql command can be used to attach to existing or\ncreate new database files.  ATTACH can also be used to attach to  multiple  databases  within\nthe  same interactive session.  This is useful for migrating data between databases, possibly\nchanging the schema along the way.\n\nOptionally, a SQL statement or set of SQL statements can be supplied as  a  single  argument.\nMultiple statements should be separated by semi-colons.\n\nFor example:\n\n$ sqlite3 -line mydata.db 'select * from memos where priority > 20;'\ntext = lunch with Christine\npriority = 100\n\n\n\nSQLITE META-COMMANDS\nThe  interactive  interpreter  offers  a set of meta-commands that can be used to control the\noutput format, examine the currently attached database files, or perform administrative oper‐\nations upon the attached databases (such as rebuilding indices).   Meta-commands  are  always\nprefixed with a dot (.).\n\nA  list  of available meta-commands can be viewed at any time by issuing the '.help' command.\nFor example:\n\nsqlite> .help\n\n\nThe available commands differ by version and build options, so  they  are  not  listed  here.\nPlease refer to your local copy for all available options.\n\n\n",
            "subsections": []
        },
        "INIT FILE": {
            "content": "sqlite3 reads an initialization file to set the configuration of the interactive environment.\nThroughout  initialization, any previously specified setting can be overridden.  The sequence\nof initialization is as follows:\n\no The default configuration is established as follows:\n\n\nmode            = LIST\nseparator       = \"|\"\nmain prompt     = \"sqlite> \"\ncontinue prompt = \"   ...> \"\n\n\no If the file ${XDGCONFIGHOME}/sqlite3/sqliterc or ~/.sqliterc exists, the first  of  those\nto be found is processed during startup.  It should generally only contain meta-commands.\n\no If the -init option is present, the specified file is processed.\n\no All other command line options are processed.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "https://sqlite.org/cli.html\nhttps://sqlite.org/fiddle (a WebAssembly build of the CLI app)\nThe sqlite3-doc package.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "This  manual  page was originally written by Andreas Rottmann <rotty@debian.org>, for the De‐\nbian GNU/Linux system (but may be used by others). It was subsequently revised by  Bill  Bum‐\ngarner <bbum@mac.com>, Laszlo Boszormenyi <gcs@debian.hu>, and the sqlite3 developers.\n\nFri Aug 11 23:50:12 CET 2023                          SQLITE3(1)",
            "subsections": []
        }
    },
    "summary": "sqlite3 - A command line interface for SQLite version 3",
    "flags": [],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Interface to SQLite 3, which is a self-contained file-based embedded SQL engine.",
        "examples": [
            {
                "description": "Start an interactive shell with a new database",
                "command": "sqlite3"
            },
            {
                "description": "Open an interactive shell against an existing database",
                "command": "sqlite3 {{path/to/database.sqlite3}}"
            },
            {
                "description": "Execute an SQL statement against a database and then exit",
                "command": "sqlite3 {{path/to/database.sqlite3}} '{{SELECT * FROM some_table;}}'"
            }
        ]
    }
}