Installation & Quick Start

Get Teide up and running in minutes. Build from source with Cargo and start querying data.

Prerequisites

Build from Source

git clone https://github.com/TeideDB/teide-rs.git
cd teide-rs
cargo build --release --all-features

Note: The build process automatically fetches and compiles the Teide C17 core. No external libraries required.

Feature Flags

Feature Enables Dependencies
(default) Core library + SQL engine sqlparser
cli Interactive REPL binary reedline, clap, nu-ansi-term
server PgWire server binary tokio, pgwire, async-trait, futures, clap

Build only what you need:

cargo build --release --features cli      # REPL only
cargo build --release --features server   # Server only
cargo build --release --all-features      # Everything

Your First REPL Session

# Start the interactive REPL
cargo run --release --features cli

# Or with a CSV file preloaded as table 't'
cargo run --release --features cli -- data.csv
teide> CREATE TABLE t (id INTEGER, name VARCHAR, score REAL);
teide> INSERT INTO t VALUES (1, 'alice', 95.0), (2, 'bob', 87.5), (3, 'carol', 92.0);
teide> SELECT name, score FROM t ORDER BY score DESC;

Your First Server Session

# Start the PgWire server
cargo run --release --features server -- --port 5433

# Connect with psql from another terminal
psql -h 127.0.0.1 -p 5433
# Preload CSV files at startup
cargo run --release --features server -- \
  --load trades=data/trades.csv \
  --load users=data/users.csv

Using as a Library

use teide::{Context, Session, ExecResult};

fn main() -> teide::Result<()> {
    let mut session = Session::new()?;
    session.execute("CREATE TABLE t AS SELECT * FROM read_csv('data.csv')")?;

    match session.execute("SELECT * FROM t LIMIT 5")? {
        ExecResult::Query(result) => {
            println!("{} rows, {} cols", result.table.nrows(), result.columns.len());
        }
        ExecResult::Ddl(msg) => println!("{msg}"),
    }
    Ok(())
}