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 / packageInstall
pnpm add @reddb/clientExample
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?")Install
pip install reddbExample
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?")Install
cargo add reddbExample
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?;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 / packageInstall
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?")Install
# header-only — copy include/reddbExample
#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 / packageInstall
# 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-postgresGo
Planned
Native Go driver is on the roadmap. For now: use the Postgres wire driver via lib/pq or pgx.
Source / packageDon'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.