Skip to main content

TimedKeepsakeRepository

Type Alias TimedKeepsakeRepository 

Source
pub type TimedKeepsakeRepository<'repo, C = NoopRelationCache> = TimedSqlxKeepsakeRepository<'repo, PostgresBackend, C>;
Expand description

Default Postgres timestamp-scoped repository view.

Aliased Type§

pub struct TimedKeepsakeRepository<'repo, C = NoopRelationCache> { /* private fields */ }

Implementations§

Source§

impl<C> TimedKeepsakeRepository<'_, C>
where C: RelationCache,

Source

pub async fn upsert_relation( &self, relation: &RelationDefinition, ) -> RepositoryResult<RelationDefinition>

Inserts or updates a relation definition using this view’s timestamp.

Source

pub async fn upsert_relation_spec<Spec>( &self, ) -> RepositoryResult<RelationDefinition>
where Spec: RelationSpec,

Inserts or updates a typed relation spec using this view’s timestamp.

Source

pub async fn set_relation_enabled( &self, relation_id: RelationId, enabled: bool, ) -> RepositoryResult<bool>

Enables or disables a relation using this view’s timestamp.

Source

pub async fn due_timed_expiry( &self, limit: i64, ) -> RepositoryResult<Vec<TimedExpiryCandidate>>

Lists due timed expiry candidates using this view’s timestamp.

Source

pub async fn expire_due_timed(&self, limit: i64) -> RepositoryResult<u64>

Expires a stable batch of due timed keepsakes using this view’s timestamp.

Source

pub async fn fulfillment_snapshot( &self, keepsake_id: Uuid, ) -> RepositoryResult<FulfillmentSnapshot>

Reads the persisted fulfillment counter snapshot for a keepsake.

Source

pub async fn due_fulfilled_expiry( &self, limit: i64, ) -> RepositoryResult<Vec<FulfilledExpiryCandidate>>

Lists fulfillment expiry candidates.

Source

pub async fn expire_due_fulfilled(&self, limit: i64) -> RepositoryResult<u64>

Expires fulfillment-satisfied keepsakes using this view’s timestamp.

Source

pub async fn upsert_counter_projection( &self, keepsake_id: Uuid, key: &str, value: i64, ) -> RepositoryResult<()>

Upserts a simple fulfillment counter projection using this view’s timestamp.

Source

pub async fn increment_counter_projection( &self, keepsake_id: Uuid, key: &str, delta: i64, ) -> RepositoryResult<i64>

Atomically increments a fulfillment counter using this view’s timestamp.

Source

pub async fn upsert_checklist_projection( &self, keepsake_id: Uuid, item: &str, complete: bool, ) -> RepositoryResult<()>

Upserts a checklist item completion projection using this view’s timestamp.