Install the complete package with local command reference and every published mode.
install sqlitesqliteUse
sqlite [options] · sqlite : <sql>sqliteshow the current
sqlite -c <file> [-f] [-m [name]]open an
-use <file>open another existing
-lshow attached database files
-tlist tables and views
-s <table>show columns and data types
-n <table> [rows]preview table rows
-f <table> <text> [rows]find text across table columns
-o <table> [-j|-csv] [file] [-f]export table rows
-a <table> : <json>insert one row from a JSON object
-w <table> <field> <value> : <json>update matching rows from a JSON object
-d <table> <field> <value>delete matching rows
-m [name]save the current database in .lil.key; default name is the file name
-M <name>remove a saved database
-k [name]list saved databases or inspect one
-K <name>open a saved database
-eclose the selected database file
sqlite : <sql>execute native SQL
sqlite load <file.sql>execute SQL from a file
sqlite dump [file.sql] [-f]create a schema and data dump
Open an existing file using -s products shows the column structure, -n products 3 previews records and -f products "shoe" searches. -o exports one table to JSON/CSV; dump produces a SQL script, while load executes one; -use switches files.
Opening without -f does not create a missing database, and symbolic-link paths are rejected. -a/-w/-d and native SQL can immediately alter the real file: make a copy first, especially before load or schema changes. -m optionally stores the file path in .lil.key, with -k/-K/-M to manage saved profiles. A table export stops above 100,000 rows. The example data comes from the bundled sandbox/db/shop.sqlite, not the visitor’s files.
Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.
Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.
Base and Minimum are two packages of the same current module release, not separate command versions.
Install the complete package with local command reference and every published mode.
install sqliteInstall the reduced package. Local reference is omitted;
install sqlite -mInstall exactly this published version.
install sqlite -v 1.1.5Ask upgrade to check compatibility and replace the installed block only when needed.
upgrade sqliteRemove the extension block while leaving the core and unrelated modules intact.
install sqlite -uExamples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.
sqlite -c db/shop.sqliteStatus connected
File sandbox/db/shop.sqlite
SQLite (version depends on the host)sqliteStatus connected
File sandbox/db/shop.sqlite
SQLite (version depends on the host)sqlite -c db/new-shop.sqlite -fStatus connected
File sandbox/db/new-shop.sqlite
SQLite (version depends on the host)sqlite -c db/shop.sqlite -m shop-demoStatus connected
File sandbox/db/shop.sqlite
SQLite (version depends on the host)
Saved shop-demosqlite -use db/shop.sqliteStatus connected
File sandbox/db/shop.sqlitesqlite -lseq name file
0 main sandbox/db/shop.sqlitesqlite -tname type
orders table
products tablesqlite -s productscid name type notnull dflt_value pk
0 id INTEGER 0 NULL 1
1 sku TEXT 1 NULL 0
2 name TEXT 1 NULL 0
3 category TEXT 1 NULL 0
4 price REAL 1 NULL 0
5 active INTEGER 1 1 0sqlite -n products 3id sku name category price active
1 SHOE-1 City shoe shoes 79.9 1
2 SHOE-2 Trail shoe shoes 109.0 1
3 BAG-1 Canvas bag bags 44.5 1sqlite -f products "shoe" 3id sku name category price active
1 SHOE-1 City shoe shoes 79.9 1
2 SHOE-2 Trail shoe shoes 109.0 1sqlite -o products -j[
{
"id": 1,
"sku": "SHOE-1",
"name": "City shoe",
"category": "shoes",
"price": 79.9,
"active": 1
},
{
"id": 2,
"sku": "SHOE-2",
"name": "Trail shoe",
"category": "shoes",
"price": 109.0,
"active": 1
},
{
"id": 3,
"sku": "BAG-1",
"name": "Canvas bag",
"category": "bags",
"price": 44.5,
"active": 1
},
{
"id": 4,
"sku": "HAT-1",
"name": "Summer hat",
"category": "accessories",
"price": 25.0,
"active": 0
}
]sqlite -o products -csv tmp/products.csvSaved sandbox/tmp/products.csvsqlite -o products -csv tmp/products.csv -fSaved sandbox/tmp/products.csvsqlite -a products : {"sku":"NEW-1","name":"Sample","category":"test","price":5,"active":1}Inserted 1
ID 5sqlite -w products sku HAT-1 : {"price":24}Updated 1sqlite -d products sku HAT-1Deleted 1sqlite : SELECT category, COUNT(*) AS total FROM products GROUP BY categorycategory total
accessories 1
bags 1
shoes 2
Time (varies) mssqlite dump tmp/shop-backup.sqlSaved sandbox/tmp/shop-backup.sqlsqlite load db/sqlite.sqlSQLite error: table products already existssqlite -m shop-demoSaved shop-demosqlite -kNo saved connectionssqlite -K missingSaved connection not found: missingsqlite -M missingSaved connection not found: missingsqlite -e+sqlite -c db/missing.sqliteDatabase file not foundsqlite -c db/shop.sqlite -use db/missing.sqliteDatabase file not foundsqlite -s missing_tableTable not found: missing_tablesandbox/db/sqlite.sqlThe example uses a file or directory from the protected /sandbox/ documentation workspace.
CREATE TABLE products (
id INTEGER PRIMARY KEY,
sku TEXT UNIQUE NOT NULL,
name TEXT NOT NULL,
category TEXT NOT NULL,
price REAL NOT NULL,
active INTEGER NOT NULL DEFAULT 1
);
INSERT INTO products (sku,name,category,price,active) VALUES
('SHOE-1','City shoe','shoes',79.90,1),
('SHOE-2','Trail shoe','shoes',109.00,1),
('BAG-1','Canvas bag','bags',44.50,1);
Current stable release of