Skip to main content

WorkaDB

WorkaDB is an embedded, serverless PostgreSQL build designed to run in-process without a postmaster. It exposes a stable C ABI (wepg_*) and a Rust wrapper so applications can use full PostgreSQL semantics on iOS, Android, and desktop without running a server.

The goal is SQLite-like simplicity with PostgreSQL power: a single library, deterministic lifecycle, and predictable SQL behavior across platforms.

Quick start

git clone https://github.com/worka-ai/workadb.git
cd workadb/workadb/build
ARCH=arm64 ./build_desktop.sh
use workadb_sys::{Workadb, WorkadbConfig};

std::env::set_var(
"WORKADB_TEMPLATE_PATH",
"/path/to/share/workadb/pgdata-template",
);
std::env::set_var(
"WORKADB_EXEC_PATH",
"/path/to/bin/postgres",
);

let pgdata = "/tmp/workadb/pgdata";
let tmp = "/tmp/workadb/tmp";
std::fs::create_dir_all(tmp)?;

let config = WorkadbConfig::new(pgdata, tmp);
let engine = Workadb::init(&config)?;
engine.exec_sql("CREATE TABLE issues (id INT, title TEXT);")?;
engine.exec_sql("INSERT INTO issues VALUES (1, 'Sink leak');")?;
let frame = engine.exec_sql("SELECT * FROM issues ORDER BY id;")?;
println!("{:?}", frame.rows);
engine.shutdown()?;

What it provides

  • PostgreSQL 18.1 query semantics in-process.
  • No server process and no TCP listeners.
  • A stable ABI with explicit init, step, reset, and shutdown calls.
  • Template-based initialization for zero-config startup.

Bindings

Python, NodeJS, and Java bindings are planned and coming soon.

Where to go next

  • Review the lifecycle and init model in Fundamentals.
  • Understand the embedded backend in Architecture.
  • See the C and Rust APIs in Reference.