chronon-backend-postgres 0.1.3

PostgreSQL SchedulerStore adapter for Chronon
Documentation

chronon-backend-postgres

Shared durable PostgreSQL SchedulerStore for production coordinator–worker clusters.

Compose with Chronon

use std::sync::Arc;
use chronon::prelude::*;
use chronon_backend_postgres::PostgresSchedulerStore;

let store: Arc<dyn SchedulerStore> = Arc::new(
    PostgresSchedulerStore::connect("postgres://user:pass@localhost/chronon").await?,
);
let chronon = ChrononBuilder::new()
    .scheduler_store(store)
    .embedded()
    .build()?;

Runnable examples:

# Embedded boot
cargo run -p uf-chronon --example postgres_boot --features postgres

# Coordinator–worker split (shared CHRONON_POSTGRES_URL)
cargo run -p uf-chronon --example postgres_coordinator_daemon --features postgres &
CHRONON_INSTANCE_ID=worker-a cargo run -p uf-chronon --example postgres_worker_daemon --features postgres

Topology docs: Embedded / Coordinator–worker. For production claim throughput, prefer Postgres + Redis (coordinator_daemon / worker_daemon).

Environment

Variable Purpose
CHRONON_POSTGRES_URL Primary URL for tests and CI
CHRONON_TEST_POSTGRES_URL Fallback test URL

Use postgres_test_url() to resolve URL precedence in test helpers.

Isolated schemas (PostgresSchedulerStore::connect_isolated / CHRONON_POSTGRES_SCHEMA) must pass validate_postgres_schema_name — only ^[A-Za-z_][A-Za-z0-9_]*$ up to 63 characters.

Cargo feature

Enable via chronon crate feature postgres:

chronon = { git = "...", default-features = false, features = ["postgres"] }

Contract tests

export CHRONON_POSTGRES_URL=postgres://user:pass@localhost/chronon
cargo test -p chronon-backend-postgres --tests -- --include-ignored

Documentation

cargo doc -p chronon-backend-postgres --no-deps --open

See also: chronon-backend-sql-common.