PostgresJobStore
The reference JobStore: Postgres on plain JDBC, no driver classes and no ORM. Every contract rule is enforced by single SQL statements against database time:
claim and dueSchedules are one
FOR UPDATE SKIP LOCKEDclaim each: atomic across concurrent callers, due-ness decided bynow(), fences bumped in the same statement.transition and completeFire are compare-and-set
UPDATEs; a stale state or fence changes nothing.The uniqueKey rule is a partial unique index, not application logic.
sweep compiles the declarative RetentionPolicy into bulk
DELETEs.
Instants are stored with Postgres's microsecond precision; sub-microsecond components of caller-supplied times are truncated on write and in comparisons.
Functions
Applies the bundled migrations now, regardless of PostgresStoreConfig.autoMigrate. Idempotent and safe under concurrent callers (advisory-locked). With autoMigrate on, the store calls this lazily before its first statement.