Skip to content

PetraDB

A PostgreSQL-syntax-compatible SQL database that runs in-memory, in the browser, or on disk. No Docker, no server — just import and query.

npm install and go

Add a real SQL database to any JavaScript or TypeScript project as a dependency — no Docker, no native bindings, no server process.

Scala cross-project

Written in Scala 3, cross-compiled to JVM, Scala.js, and Scala Native. Use the same database library across platforms from a single codebase.

PostgreSQL-syntax-compatible

Real SQL — DDL, DML, joins, aggregations, subqueries, transactions, and prepared statements with familiar PostgreSQL syntax.

In-memory by default

Spin up a full SQL database in one line. Perfect for tests, prototyping, browser apps, and anywhere you need SQL without infrastructure.

Grows with you

Start in-memory for fast iteration, then switch to crash-safe persistent storage in a single file — no migration, no config change.

Runs in the browser

The engine compiles to JavaScript with zero native dependencies, so it works in Node.js, Deno, Bun, and directly in the browser.