Skip to main content

PostgresPendingStore

Struct PostgresPendingStore 

Source
pub struct PostgresPendingStore { /* private fields */ }
Expand description

PostgreSQL-backed PendingAdjudicationPort implementation.

Uses the same r2d2 pool as PostgresPersistenceStore. Each method borrows a pooled connection for the duration of a single non-transactional statement (auto-commit). Serialization is provided by the per-agent write lock in EngineHandle.

Implementations§

Source§

impl PostgresPendingStore

Source

pub fn new(pool: Pool<PostgresConnectionManager<NoTls>>) -> Self

Create a pending store sharing the same connection pool.

Trait Implementations§

Source§

impl PendingAdjudicationPort for PostgresPendingStore

Source§

fn list_queued_orphan_claims( &self, ) -> Result<Vec<OrphanedQueuedClaim>, PostgresStoreError>

Detect QueuedForAdjudication claims with no matching pending row (Postgres adapter).

Same approach as SQLite: cross-table query joining ledger_entries + claims + pending_adjudications.

Source§

type Error = PostgresStoreError

Source§

fn insert_pending( &self, row: &PendingAdjudicationRow, ) -> Result<(), PostgresStoreError>

Persist a new pending-adjudication row (status = ‘pending’, expires_at = NULL). Read more
Source§

fn get_pending( &self, handle_id: Uuid, ) -> Result<Option<PendingAdjudicationRow>, PostgresStoreError>

Lookup a pending row by its handle_id. Returns None if not found.
Source§

fn list_pending( &self, agent_id: Option<&AgentId>, ) -> Result<Vec<PendingAdjudicationRow>, PostgresStoreError>

List all pending rows for an agent (or all agents if agent_id is None). Ordered by queued_at ASC.
Source§

fn list_expired( &self, now: DateTime<Utc>, ) -> Result<Vec<PendingAdjudicationRow>, PostgresStoreError>

List all rows whose expires_at is not NULL, expires_at <= now, and status = 'pending'. Used by the sweep use-case. Ordered by expires_at ASC.
Source§

fn mark_resolved(&self, handle_id: Uuid) -> Result<(), PostgresStoreError>

Mark a pending row as resolved (status = ‘resolved’). Used by the verdict-apply step. Read more
Source§

fn mark_expired(&self, handle_id: Uuid) -> Result<(), PostgresStoreError>

Mark a pending row as expired (status = ‘expired’). Used by the sweep and lazy expiry path. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.