@reventlessdev/reventless-postgres
v3.0.0-alpha.20
Published
Postgres storage backend for Reventless (classic + DCB event logs, query DB, change feed). Connection-string only — RDS/Aurora, any managed provider, or a local container.
Downloads
4,662
Readme
@reventlessdev/reventless-postgres
⚠️ Alpha. APIs and on-disk formats can change without notice between releases. Pin exact versions and expect breaking changes.
The Postgres storage backend for Reventless — a spec-driven, event-sourced CQRS framework written in ReScript. It implements the core storage adapters (classic and DCB event logs, the query database, and change feeds) over a plain Postgres connection. It carries no IaC/provider SDK dependency: it connects by connection string, so it runs against RDS/Aurora, any managed provider, or a local container.
What it provides
ReScript modules, consumed by adding the package to your rescript.json dependencies:
PgDriver— thenode-postgres(pg) binding (pool/client). Accepts a fullconnectionStringor discrete fields, with SSL and rotating-secret (password-provider) support.PgSchema— an idempotent schema + migration runner (ensureSchema(pool)), safe to run on every startup and concurrently across processes.EventLogStorage_Postgres— the classic optimistic-concurrency event log (event_log/snapshot).DcbEventLogStorage_Postgres— the DCB (Dynamic Consistency Boundary) event log with a global position sequence and a concurrency-criticaldcb_append.QueryDbStorage_Postgres— read-side storage over JSONBqdb_<name>tables.QueryEnginePostgres— compiles the core QueryEngine query/scan AST down to SQL, pushing filters into the database.EventLogChangeFeed/PgChangeFeed— checkpointed change feeds for the classic and DCB logs, using anxmin-fenced read plusLISTEN/NOTIFY(pg_notify) for near-real-time wakeup. A documented public consumer surface.
The *_Ops modules hold the runtime-pure operations (no Pulumi import) so a
deployed handler's ESM graph stays clean; the wrapper modules add the deploy-time
adapter shape.
Where it fits
reventless-postgres is a storage adapter for the Reventless framework.
reventless-core
is provider-agnostic; this package supplies the Postgres implementation of its
event-log, query-db, and change-feed interfaces:
@reventlessdev/reventless-aws— AWS (DynamoDB, Lambda, SQS, SNS, S3); can delegate event logs to this package for managed Postgres@reventlessdev/reventless-postgres— this package@reventlessdev/reventless-local— in-memory / SQLite platform that uses this storage against a local Postgres
Because it depends only on pg (plus
reventless-core,
reventless-infra,
and reventless-spec),
the platform package that embeds it owns provisioning; this package only needs a
reachable Postgres.
Install
pnpm add @reventlessdev/reventless-postgresThen register it as a ReScript dependency in rescript.json:
{
"dependencies": ["@reventlessdev/reventless-postgres"]
}Requires ReScript ^12.3.0 (peer dependency).
Links
- 📚 Documentation — docs.reventless.dev
- 📦 Repository — ReventlessDev/reventless-core
- 📋 Changelog
