pub struct PgWorkflowStore { /* private fields */ }Expand description
PostgreSQL workflow storage using either a single PgDriver or a PgPool.
Implementations§
Source§impl PgWorkflowStore
impl PgWorkflowStore
Create a store around a shared driver handle.
Sourcepub fn from_pool(pool: PgPool) -> Self
pub fn from_pool(pool: PgPool) -> Self
Create a store around an existing PostgreSQL connection pool.
The store uses raw pooled connections because workflow ledger tables are internal runtime state, not tenant-scoped application data.
Sourcepub async fn connect_url(url: &str) -> Result<Self, WorkflowError>
pub async fn connect_url(url: &str) -> Result<Self, WorkflowError>
Connect a store from a PostgreSQL URL.
Sourcepub fn with_tables(self, tables: PgWorkflowTables) -> Self
pub fn with_tables(self, tables: PgWorkflowTables) -> Self
Override storage table names.
Sourcepub fn with_timeout_claim_ttl(self, ttl: Duration) -> Self
pub fn with_timeout_claim_ttl(self, ttl: Duration) -> Self
Override how long a timeout drain claim should be held.
Sourcepub fn with_in_progress_ttl(self, ttl: Duration) -> Self
pub fn with_in_progress_ttl(self, ttl: Duration) -> Self
Override how long a started operation or side effect is considered in progress.
Sourcepub fn tables(&self) -> &PgWorkflowTables
pub fn tables(&self) -> &PgWorkflowTables
Return the storage table names.
Sourcepub fn schema_commands(&self) -> Vec<Qail>
pub fn schema_commands(&self) -> Vec<Qail>
Return QAIL AST schema commands for this store.
Sourcepub async fn install_schema(&self) -> Result<(), WorkflowError>
pub async fn install_schema(&self) -> Result<(), WorkflowError>
Execute the schema commands through the AST driver path.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PgWorkflowStore
impl !UnwindSafe for PgWorkflowStore
impl Freeze for PgWorkflowStore
impl Send for PgWorkflowStore
impl Sync for PgWorkflowStore
impl Unpin for PgWorkflowStore
impl UnsafeUnpin for PgWorkflowStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more