Expand description
PostgreSQL schema and SQLx boundary for Dovecote.
This crate publishes versioned PostgreSQL migration artifacts and implements the caller-transaction-bound enqueue, schema verification, leased lifecycle operations, and live and finite snapshot paging for Dovecote. The locking, database-time, fencing, and rollback contracts are covered by repository tests; release advertisement remains subject to the published support matrix and release gates.
Structs§
- Crate
Version - Numeric crate version used to evaluate migration compatibility without parsing free-form requirement strings.
- Migration
- An immutable SQL artifact whose compatibility metadata cannot be fabricated by callers of the adapter crate.
- Migration
Compatibility - A checked crate-version range for a migration artifact.
- Migration
Compatibility Error - Returned when a migration’s maximum supported release precedes its minimum.
- Postgres
Dovecote - PostgreSQL adapter for Dovecote’s durable event and delivery schema.
- Snapshot
Pager - A bounded, finite read over one PostgreSQL repeatable-read snapshot.
Enums§
- Claim
Error - Errors returned while selecting and claiming a batch of events.
- Enqueue
Error - Finalize
Error - Errors returned by the migration-only delivery finalizer.
- Import
Error - Errors returned by the migration-only importer.
- Mutation
Error - Errors returned by fenced post-claim mutations.
- Page
Error - Errors returned by live and snapshot paging.
- Schema
Error - Transient
Kind - PostgreSQL SQLSTATE categories for failures callers may retry as a whole operation. The original SQLx error remains available as the source.
Constants§
- MIGRATIONS
- The migration sequence shipped with this adapter; entries are append-only.
- SCHEMA_
VERSION - Schema version adapters compare before using these migration artifacts.
Functions§
- ack
- Acknowledges one current, unexpired claim.
- begin_
snapshot - Starts a finite PostgreSQL snapshot pager.
- check_
schema - Verifies the tables and all columns required by schema version 1.
- claim
- Claims pending and expired events in ascending row-id order.
- enqueue
- Inserts an event and its pending delivery in the supplied caller transaction.
- finalize_
pending_ delivery_ for_ migration - Finalises one canonical pending migration import in the caller-owned transaction.
- import_
for_ migration - Imports one event and a portable legacy delivery state in the supplied transaction. The caller remains responsible for commit or rollback.
- page
- Reads a bounded live page after
after_row_id. - quarantine
- Moves one current, unexpired claim to the terminal quarantined state.
- release
- Returns one current, unexpired claim to pending after a delay.
- renew
- Renews one current, unexpired claim using PostgreSQL’s current time.
- retry
- Returns one current, unexpired claim to pending and records its failure.