Skip to main content
Turso is currently in BETA. It may contain bugs and unexpected behavior. Use caution with production data and ensure you have backups.

Interactive shell

The fastest way to try Turso is through the tursodb interactive SQL shell.
1

Install the CLI

Run the installer script to download the latest tursodb binary:
curl --proto '=https' --tlsv1.2 -LsSf \
  https://github.com/tursodatabase/turso/releases/latest/download/turso_cli-installer.sh | sh
Alternatively, install with Homebrew on macOS:
brew install turso
2

Start the interactive shell

Launch tursodb to open an in-memory SQL session:
tursodb
You should see:
Turso
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database
turso>
To work with a persistent file instead of memory, pass a filename: tursodb mydb.db
3

Create a table and insert data

Run these SQL statements in the shell:
CREATE TABLE users (id INT, username TEXT);
INSERT INTO users VALUES (1, 'alice');
INSERT INTO users VALUES (2, 'bob');
4

Query your data

Retrieve the rows you just inserted:
SELECT * FROM users;
Output:
turso> SELECT * FROM users;
┌────┬──────────┐
│ id │ username │
├────┼──────────┤
│  1 │ alice    │
├────┼──────────┤
│  2 │ bob      │
└────┴──────────┘
5

Inspect the schema

Use the .schema shell command to view table definitions:
.schema users
CREATE TABLE users (id INT, username TEXT);
To exit the shell, press Ctrl+D or type .quit.

Use Turso from code

Turso provides native bindings for Rust, JavaScript, Python, Go, and Java. Choose your language below.
Add the turso crate to your project:
cargo add turso
cargo add tokio --features full
Then connect and query:
use turso::Builder;

#[tokio::main]
async fn main() -> turso::Result<()> {
    let db = Builder::new_local(":memory:").build().await?;
    let conn = db.connect()?;

    conn.execute(
        "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT)",
        ()
    ).await?;

    conn.execute(
        "INSERT INTO users (name, email) VALUES (?1, ?2)",
        ["Alice", "[email protected]"]
    ).await?;

    let mut rows = conn.query("SELECT * FROM users", ()).await?;

    while let Some(row) = rows.next().await? {
        let id = row.get_value(0)?;
        let name = row.get_value(1)?;
        let email = row.get_value(2)?;
        println!("User: {} - {} ({})",
            id.as_integer().unwrap_or(&0),
            name.as_text().unwrap_or(&"".to_string()),
            email.as_text().unwrap_or(&"".to_string())
        );
    }

    Ok(())
}

Next steps

Installation

All installation methods: curl, Homebrew, Cargo, and each language binding.

Transactions

Learn about deferred, immediate, and concurrent transactions.

Vector search

Store and query embeddings for semantic search and recommendations.

CLI reference

Full reference for shell commands and command-line options.

Build docs developers (and LLMs) love