Drivers

One engine. Every language teams ship in.

First-class native drivers for the seven languages we see most in production stacks, plus the Postgres wire protocol so anything that talks to Postgres talks to RedDB.

JavaScript / TypeScript

Stable

First-class driver. Used by the RedDB control plane and the tetis-lair backends.

Source / package

Install

pnpm add @reddb/client

Example

import { createClient } from '@reddb/client'

const db = createClient({ url: 'red://localhost:5050', token: process.env.RED_TOKEN })

await db.sql`INSERT INTO users (id, name) VALUES (${42}, ${'Alice'})`
const rows = await db.sql`SELECT * FROM users WHERE id = ${42}`
const answer = await db.ask("who owns passport AB1234567?")

Python

Stable

Async + sync clients with pandas-friendly result rows.

Source / package

Install

pip install reddb

Example

from reddb import Client

db = Client(url="red://localhost:5050", token=os.environ["RED_TOKEN"])

db.sql("INSERT INTO users (id, name) VALUES (?, ?)", 42, "Alice")
rows = db.sql("SELECT * FROM users WHERE id = ?", 42).rows()
answer = db.ask("who owns passport AB1234567?")

Rust

Stable

Native to the engine — same crate the server uses internally.

Source / package

Install

cargo add reddb

Example

use reddb::Client;

let db = Client::connect("red://localhost:5050").await?;

db.sql("INSERT INTO users (id, name) VALUES (?, ?)")
  .bind(42).bind("Alice")
  .execute().await?;

let rows = db.sql("SELECT * FROM users WHERE id = ?").bind(42).fetch_all().await?;
let answer = db.ask("who owns passport AB1234567?").await?;

Java

Beta

JVM driver shared with the Kotlin client. Gradle + Maven coordinates.

Source / package

Install

implementation("io.reddb:reddb-client:0.2")

Example

var db = RedDb.connect("red://localhost:5050", token);

db.sql("INSERT INTO users (id, name) VALUES (?, ?)", 42, "Alice");
var rows = db.sql("SELECT * FROM users WHERE id = ?", 42).rows();
var answer = db.ask("who owns passport AB1234567?");

Kotlin

Beta

Coroutine-friendly wrapper around the JVM driver, with Flow and suspend functions.

Source / package

Install

implementation("io.reddb:reddb-client-kotlin:0.2")

Example

val db = RedDb.connect("red://localhost:5050", token)

db.sql("INSERT INTO users (id, name) VALUES (?, ?)", 42, "Alice")
val rows: Flow<Row> = db.sql("SELECT * FROM users WHERE id = ?", 42).rows()
val answer = db.ask("who owns passport AB1234567?")

C++

Beta

Header-only C++17 client. Useful for embedded / native tooling.

Source / package

Install

# header-only — copy include/reddb

Example

#include <reddb/client.hpp>

reddb::Client db("red://localhost:5050", token);

db.sql("INSERT INTO users (id, name) VALUES (?, ?)", 42, "Alice");
auto rows = db.sql("SELECT * FROM users WHERE id = ?", 42).rows();
auto answer = db.ask("who owns passport AB1234567?");

Postgres-wire

Stable

RedDB speaks the Postgres wire protocol on port 5435. Drop-in for tools that already speak Postgres.

Source / package

Install

# any Postgres driver — psql, pg, asyncpg, pgx, JDBC, etc.

Example

psql "postgres://admin:admin@localhost:5435/reddb"

# or from any Postgres client:
#   pg / node-postgres (Node)
#   asyncpg / psycopg (Python)
#   pgx / lib/pq (Go)
#   JDBC PostgreSQL driver (JVM)
#   Rust sqlx / tokio-postgres

Go

Planned

Native Go driver is on the roadmap. For now: use the Postgres wire driver via lib/pq or pgx.

Source / package

Don't see your stack?

The Postgres wire protocol covers most production stacks today (Go, .NET, PHP, Ruby, Elixir, …). For a native driver, open an issue and we will scope it.