@drej/postgres
v0.3.8
Published
Postgres storage adapter for [drej](https://drej.dev). Stores the sandbox ledger in a Postgres database — suitable for production deployments where multiple processes or machines share the same ledger.
Readme
@drej/postgres
Postgres storage adapter for drej. Stores the sandbox ledger in a Postgres database — suitable for production deployments where multiple processes or machines share the same ledger.
bun add @drej/postgresFor local development, @drej/sqlite is simpler and requires no infrastructure.
Usage
import { Drej } from "drej";
import { PostgresAdapter } from "@drej/postgres";
const client = new Drej({
baseUrl: "http://localhost:8080",
adapter: new PostgresAdapter("postgresql://user:pass@localhost:5432/drej"),
});The adapter initialises lazily on first use and runs idempotent migrations (CREATE TABLE IF NOT EXISTS) on startup — no separate migration step needed.
License
Apache 2.0
