@uniora/postgres
v0.14.1
Published
PostgreSQL storage adapter for @uniora/core
Maintainers
Readme
@uniora/postgres
PostgreSQL storage adapter for UNIORA. Everything lives in a dedicated uniora schema, so it never collides with your own tables. It passes the same behavioural conformance suite as @uniora/sqlite, including the concurrency and security regressions, against a real database.
npm install @uniora/core @uniora/postgres pgimport { Pool } from "pg";
import { applyMigrations, createPostgresStorage } from "@uniora/postgres";
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
await applyMigrations(pool); // additive and idempotent, tracked in a ledger
const storage = createPostgresStorage(pool);- Migrations are never destructive.
npx uniora migrate --statusexits 1 in CI if some are pending or were edited after being applied. - The audit log is append-only in the database itself (triggers) and hash-chained.
- For production, run the app with the least-privilege role from
guides/sql/least-privilege-roles.sqland migrations with another.
Documentation: Storage guide and the full index.
License: Apache-2.0.
