Expand description
PostgreSQL persistence layer for Runledger durable execution.
This crate owns the SQLx-backed storage and query helpers used by the
runtime and application crates. The main entrypoint is the jobs module,
which exposes APIs for:
- queueing, claiming, heartbeating, and completing jobs
- listing admin/job log data and runtime configuration
- enqueueing and querying workflow runs and steps
- applying or validating the bundled Runledger schema migrations
Typical consumers share a DbPool with runledger-runtime, then call the
exported jobs functions from application setup, admin APIs, or tests.
For simple embedding, call migrate during startup:
let pool = sqlx::PgPool::connect("postgres://localhost/runledger").await?;
runledger_postgres::migrate(&pool).await?;For deployments that manage DDL elsewhere, call
ensure_schema_compatible instead to fail fast if the schema is missing
or drifted. That check is read-only, but it expects the database to retain
SQLx migration history in _sqlx_migrations and, when available,
Runledger-owned migration state in runledger_migration_history.
Modules§
Structs§
Enums§
Statics§
Functions§
- classify_
framework_ constraint - classify_
query_ error - classify_
query_ error_ with_ constraint_ classifier - ensure_
schema_ compatible - Validate that the target database’s SQLx migration history matches the bundled Runledger migrations.
- has_
framework_ constraint_ classifier - migrate
- Apply the bundled Runledger schema migrations to a PostgreSQL pool.