Install the complete package with local command reference and every published mode.
install dbdbUse
: stays in the database’s native language. This keeps routine work short without pretending that SQL, Redis data structures and MongoDB documents are the same model.
db [driver] [options]dbshow the selected database driver and installed drivers
db <driver>select a driver: mysql|postgresql|redis|sqlite|mongodb
-c ...connect through the selected driver
-use ...select a database through the selected driver
-llist databases or namespaces through the selected driver
-tlist tables, collections or keys through the selected driver
-s <name>show structure through the selected driver
-n <name> [rows]preview records through the selected driver
-f <name> <text>search through the selected driver
-o <name> ...export through the selected driver
-a ...add data through the selected driver
-w ...update data through the selected driver
-d ...delete data through the selected driver
-m [name]save the current connection through the selected driver
-M <name>remove a saved connection through the selected driver
-k [name]list saved connections or inspect one through the selected driver
-K <name>connect using a saved connection through the selected driver
-edisconnect the selected driver
db : <native>run the selected driver's native query or command
db dump ...create a dump through the selected driver
db load <file>load a dump or script through the selected driver
The selected driver is stored only in the current PHP session.
All database drivers use the same core ideas where the engines allow them: -c connects, -use selects a database or file, -l lists databases or namespaces, -t lists tables/collections/keys, -s inspects structure, -n previews data, -f searches, -o exports, dump/load move backups, -e disconnects, and : passes native database syntax.
The text after : belongs to the selected database engine: SQL for MySQL/PostgreSQL/SQLite, a Redis command for Redis, and a JSON command document for MongoDB.
Credentials live only in the active PHP session and passwords are entered through the hidden secret prompt. Driver write operations use the privileges of the connected database account; restricted accounts are recommended.
The common mirror also forwards -a, -w and -d for focused add, update and delete operations; their exact arguments remain driver-specific.
Without -m, connection data remains scoped to the current PHP session. -m [name] explicitly stores the current profile in the protected .lil.key file (0600), -K <name> reconnects from it, -k lists or inspects profiles without exposing a stored password, and -M <name> removes one. kill removes .lil.key together with the other core state. Treat the file as sensitive because an opted-in profile can contain database credentials.
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 dbInstall the reduced package. Local reference is omitted;
install db -mInstall exactly this published version.
install db -v 1.3.3Ask upgrade to check compatibility and replace the installed block only when needed.
upgrade dbRemove the extension block while leaving the core and unrelated modules intact.
install db -uExamples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.
db sqlite | db -c \sandbox\db\shop.sqlite | db -t | db -n products 5Driver sqlite
Status selected
Status connected
File sandbox/db/shop.sqlite
products
orders
id sku name category price active
1 SHOE-1 City shoe shoes 79.9 1
2 SHOE-2 Trail shoe shoes 109 1
3 BAG-1 Canvas bag bags 44.5 1dbDriver sqlite
SQLite installed · selected
MySQL installed
PostgreSQL not installed
Redis not installed
MongoDB not installeddb mysqlDriver mysql
Status selected
Engine MySQL / MariaDBdb mariadbDriver mysql
Status selected
Engine MySQL / MariaDBdb -s productsField Type Null Key
id INTEGER no PRIMARY
sku TEXT no UNIQUE
name TEXT no
category TEXT no
price REAL no
active INTEGER nodb -f products "shoe"id sku name category price
1 SHOE-1 City shoe shoes 79.9
2 SHOE-2 Trail shoe shoes 109db -o products -j products.jsonSaved products.jsondb -a products : {"sku":"TMP-1","name":"Temporary","price":1}Inserted 1
ID 5db -w products sku TMP-1 : {"price":2}Updated 1db -d products sku TMP-1Deleted 1db : SELECT COUNT(*) AS products FROM productsproducts
4db dump backup.sqlSaved backup.sqldb -e+db oracleUnknown database driver: oraclesandbox/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);
Groups shared flags, forwards connection memory and keeps driver status in compact columns.