Skip to main content
tursodb is an interactive SQL shell for Turso, similar to the sqlite3 CLI. It lets you open databases, run SQL statements, and inspect schema — all from the terminal. It also doubles as an MCP server for AI assistant integration.

Installation

After installation the binary is available as tursodb.

Starting the shell

In-memory mode

Run tursodb with no arguments to start a transient in-memory database. All data is discarded when you exit.
tursodb
Turso
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database
turso>

File mode

Pass a path to open (or create) a persistent database file.
tursodb myapp.db
The file is created if it does not exist. The format is fully SQLite-compatible.

Read-only mode

Open an existing database without allowing any writes:
tursodb myapp.db --readonly

Example session

$ tursodb
Turso
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database
turso> CREATE TABLE users (id INT, username TEXT);
turso> INSERT INTO users VALUES (1, 'alice');
turso> INSERT INTO users VALUES (2, 'bob');
turso> SELECT * FROM users;
1|alice
2|bob
turso> .schema users
CREATE TABLE users (id INT, username TEXT);
turso> .quit

Command line options

OptionShortDescription
DATABASEPath to the SQLite database file. Defaults to an in-memory database (:memory:).
SQLOptional SQL statement to execute non-interactively, then exit.
--output-mode <mode>-mOutput format. pretty (default) renders a bordered table; list produces pipe-separated rows; line prints one column per line.
--output <file>-oWrite output to a file instead of stdout.
--quiet-qSuppress the startup banner.
--echo-ePrint each command before executing it.
--vfs <name>-vSelect the VFS backend. Options: syscall (default), memory, io_uring (Linux only, if feature enabled).
--readonlyOpen the database in read-only mode. Writes are rejected.
--mcpStart an MCP server instead of the interactive shell.
--sync-server <addr>Start a sync server listening at the given address (e.g. 0.0.0.0:8080) instead of the interactive shell.
--experimental-encryptionEnable encryption at rest (experimental — do not use with critical data).
--experimental-viewsEnable the experimental views feature (not production-ready).
--experimental-custom-typesEnable CREATE TYPE / DROP TYPE custom type definitions (experimental).
--experimental-index-methodEnable the experimental custom index method feature.
--experimental-autovacuumEnable the experimental autovacuum feature.
--experimental-attachEnable the experimental ATTACH DATABASE feature.
--tracing-output <file>-tWrite log traces to the specified file.
--help-hPrint help and exit.
--version-VPrint the version number and exit.

Output modes

turso> SELECT * FROM users;
┌────┬──────────┐
│ id │ username │
├────┼──────────┤
│ 1  │ alice    │
├────┼──────────┤
│ 2  │ bob      │
└────┴──────────┘
You can also switch the output mode at runtime inside the shell using the .mode command.
Turso is currently in beta. It may contain bugs and unexpected behavior. Avoid using it with critical production data without backups.

Build docs developers (and LLMs) love