Skip to main content

SqlitePool

Struct SqlitePool 

Source
pub struct SqlitePool(/* private fields */);

Implementations§

Source§

impl SqlitePool

Source

pub async fn new<P: AsRef<Path>>( path: P, config: SqliteConfig, ) -> Result<Self, InitializationError>

Trait Implementations§

Source§

impl Cas for SqlitePool

Source§

fn read_blob<'life0, 'life1, 'async_trait>( &'life0 self, digest: &'life1 ContentDigest, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, CasError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a blob by digest. Ok(None) if absent.
Source§

fn write_blob<'life0, 'life1, 'async_trait>( &'life0 self, content: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<ContentDigest, CasError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store a blob. Content-addressed and idempotent: storing bytes already present is a no-op. Returns the digest computed over content.
Source§

fn contains_blob<'life0, 'life1, 'async_trait>( &'life0 self, digest: &'life1 ContentDigest, ) -> Pin<Box<dyn Future<Output = Result<bool, CasError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Whether a blob is present, without fetching its bytes.
Source§

impl Clone for SqlitePool

Source§

fn clone(&self) -> SqlitePool

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl DbConnection for SqlitePool

Source§

fn get_expired_timers<'life0, 'async_trait>( &'life0 self, at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExpiredTimer>, DbErrorGeneric>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get currently expired delays and locks.

Source§

fn create<'life0, 'async_trait>( &'life0 self, req: CreateRequest, ) -> Pin<Box<dyn Future<Output = Result<AppendResponse, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a new execution log
Source§

fn get<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, ) -> Pin<Box<dyn Future<Output = Result<ExecutionLog, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get execution log.
Source§

fn get_cancelling<'life0, 'async_trait>( &'life0 self, batch_size: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExecutionId>, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execution ids whose lifecycle is cancelling, for the cancellation driver to advance. Ordered oldest-first, capped at batch_size. Unlike the executor pick-up queries this is not lock/pause guarded: cancellation proceeds regardless (cancel supersedes pause).
Source§

fn append_batch<'life0, 'async_trait>( &'life0 self, current_time: DateTime<Utc>, batch: Vec<AppendRequest>, execution_id: ExecutionId, version: Version, ) -> Pin<Box<dyn Future<Output = Result<AppendBatchResponse, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Append a batch of events to an existing execution log. The batch must not contain ExecutionRequest::Created.
Source§

fn append_batch_with_delay_response<'life0, 'async_trait>( &'life0 self, current_time: DateTime<Utc>, batch: Vec<AppendRequest>, execution_id: ExecutionId, version: Version, join_set_id: JoinSetId, delay_id: DelayId, ) -> Pin<Box<dyn Future<Output = Result<AppendBatchResponse, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Append a blocking one-off delay batch (JoinSetCreate, DelayRequest, JoinNext) for a delay that is already due (e.g. sleep(now)) together with its DelayFinished response, in a single transaction. This unblocks the JoinNext immediately, so the workflow resumes without a round trip through the expired-timers watcher.
Source§

fn append_batch_create_new_execution<'life0, 'async_trait>( &'life0 self, current_time: DateTime<Utc>, batch: Vec<AppendRequest>, execution_id: ExecutionId, version: Version, child_req: Vec<CreateRequest>, backtraces: Vec<BacktraceInfo>, ) -> Pin<Box<dyn Future<Output = Result<AppendBatchResponse, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Append one or more events to the parent execution log, and create zero or more child execution logs. The batch must not contain ExecutionRequest::Created.
Source§

fn subscribe_to_next_responses<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, last_response: ResponseCursor, subscription_end_fut: Pin<Box<dyn Future<Output = ResponseSubscriptionEnd> + Send>>, ) -> Pin<Box<dyn Future<Output = Result<Vec<ResponseWithCursor>, SubscribeToResponsesError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Notification mechainism with no strict guarantees for getting notified when a new response arrives. Parameter start_idx must be at most be equal to current size of responses in the execution log. If no response arrives immediately and subscription_end_fut resolves, SubscribeToResponsesError::SubscriptionEnded is returned. Implementations with no pubsub support should use polling. Callers are expected to call this function in a loop with a reasonable timeout to support less stellar implementations.
Source§

fn wait_for_finished_result<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, timeout_fut: Option<Pin<Box<dyn Future<Output = TimeoutOutcome> + Send>>>, ) -> Pin<Box<dyn Future<Output = Result<SupportedFunctionReturnValue, DbErrorReadWithTimeout>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

First, attempt to fetch the finished value. If the execution is not finished yet, poll periodically or subscribe to db changes, racing with timeout_fut. Notification mechainism with no strict guarantees for getting the finished result. Implementations with no pubsub support should use polling. Callers are expected to call this function in a loop with a reasonable timeout to support less stellar implementations.
Source§

fn append_delay_response<'life0, 'async_trait>( &'life0 self, created_at: DateTime<Utc>, execution_id: ExecutionId, join_set_id: JoinSetId, delay_id: DelayId, result: Result<(), ()>, ) -> Pin<Box<dyn Future<Output = Result<AppendDelayResponseOutcome, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn append_backtrace<'life0, 'async_trait>( &'life0 self, append: BacktraceInfo, ) -> Pin<Box<dyn Future<Output = Result<(), DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn append_backtrace_batch<'life0, 'async_trait>( &'life0 self, batch: Vec<BacktraceInfo>, ) -> Pin<Box<dyn Future<Output = Result<usize, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn append_log<'life0, 'async_trait>( &'life0 self, row: LogInfoAppendRow, ) -> Pin<Box<dyn Future<Output = Result<(), DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn append_log_batch<'life0, 'life1, 'async_trait>( &'life0 self, batch: &'life1 [LogInfoAppendRow], ) -> Pin<Box<dyn Future<Output = Result<(), DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_execution_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, version: &'life2 Version, ) -> Pin<Box<dyn Future<Output = Result<ExecutionEvent, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get a single event specified by version. Impls may set ExecutionEvent::backtrace_id to None.
Source§

fn upsert_stub_response<'life0, 'async_trait>( &'life0 self, execution_id: ExecutionIdDerived, version: Version, req: AppendRequest, response: AppendResponseToExecution, current_time: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<(), DbErrorStubResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Idempotent stub response write. Appends a Finished event to the child execution and a response to the parent. If the child is already finished with the same retval, succeeds silently. If finished with a different retval, returns DbErrorStubResponse::StubConflict.
Source§

fn get_pending_state<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, ) -> Pin<Box<dyn Future<Output = Result<ExecutionWithState, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_create_request<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, ) -> Pin<Box<dyn Future<Output = Result<CreateRequest, DbErrorRead>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Source§

impl DbExecutor for SqlitePool

Source§

fn lock_pending_by_ffqns<'life0, 'async_trait>( &'life0 self, batch_size: u32, pending_at_or_sooner: DateTime<Utc>, ffqns: Arc<[FunctionFqn]>, created_at: DateTime<Utc>, component_id: ComponentId, deployment_id: DeploymentId, executor_id: ExecutorId, lock_expires_at: DateTime<Utc>, run_id: RunId, retry_config: ComponentRetryConfig, ) -> Pin<Box<dyn Future<Output = Result<LockPendingResponse, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn lock_pending_by_ffqns_auto<'life0, 'async_trait>( &'life0 self, batch_size: u32, pending_at_or_sooner: DateTime<Utc>, ffqns: Arc<[FunctionFqn]>, created_at: DateTime<Utc>, component_id: ComponentId, deployment_id: DeploymentId, executor_id: ExecutorId, lock_expires_at: DateTime<Utc>, run_id: RunId, retry_config: ComponentRetryConfig, ) -> Pin<Box<dyn Future<Output = Result<LockPendingResponse, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn lock_pending_by_component_digest<'life0, 'life1, 'async_trait>( &'life0 self, batch_size: u32, pending_at_or_sooner: DateTime<Utc>, component_id: &'life1 ComponentId, deployment_id: DeploymentId, created_at: DateTime<Utc>, executor_id: ExecutorId, lock_expires_at: DateTime<Utc>, run_id: RunId, retry_config: ComponentRetryConfig, ) -> Pin<Box<dyn Future<Output = Result<LockPendingResponse, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn append<'life0, 'async_trait>( &'life0 self, execution_id: ExecutionId, version: Version, req: AppendRequest, ) -> Pin<Box<dyn Future<Output = Result<AppendResponse, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Append a single event to an existing execution log. The request cannot contain ExecutionRequest::Created.
Source§

fn append_batch_respond_to_parent<'life0, 'async_trait>( &'life0 self, events: AppendEventsToExecution, response: AppendResponseToExecution, current_time: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<AppendBatchResponse, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Append a batch of events to an existing execution log, and append a response to a parent execution. The batch cannot contain ExecutionRequest::Created.
Source§

fn wait_for_pending_by_ffqn<'life0, 'async_trait>( &'life0 self, pending_at_or_sooner: DateTime<Utc>, ffqns: Arc<[FunctionFqn]>, current_digest: Option<ComponentDigest>, timeout_fut: Pin<Box<dyn Future<Output = ()> + Send>>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Notification mechainism with no strict guarantees for waiting while there are no pending executions. Return immediately if there are pending notifications at pending_at_or_sooner. Otherwise wait until timeout_fut resolves. Delay requests that expire between pending_at_or_sooner and timeout can be disregarded. If current_digest is set, ignore executions with incompatible digests.
Source§

fn wait_for_pending_by_component_digest<'life0, 'life1, 'async_trait>( &'life0 self, pending_at_or_sooner: DateTime<Utc>, component_digest: &'life1 ComponentDigest, timeout_fut: Pin<Box<dyn Future<Output = ()> + Send>>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Notification mechainism with no strict guarantees for waiting while there are no pending executions. Return immediately if there are pending notifications at pending_at_or_sooner. Otherwise wait until timeout_fut resolves. Delay requests that expire between pending_at_or_sooner and timeout can be disregarded.
Source§

fn get_last_execution_event<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, ) -> Pin<Box<dyn Future<Output = Result<ExecutionEvent, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get last event. Impls may set ExecutionEvent::backtrace_id to None.
Source§

fn append_activity_cancellation_requested<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, cancelled_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<CancelOutcome, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Append ExecutionRequest::CancellationRequested if execution is not finished and not in cancellation already. The state will become PendingStateCancelling with the underlying state embedded.
Source§

fn cancel_workflow<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, cancelled_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<CancelOutcome, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Request cancellation of a cancellable workflow. In one version-guarded transaction, appends ExecutionRequest::CancellationRequested; rejects a non-cancellable target and returns AlreadyFinished/AlreadyCancelling without appending. The Finished(Cancelled) outcome is driven later by the cancellation driver.
Source§

fn cancel_activity_with_retries<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, cancelled_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<CancelOutcome, DbErrorWrite>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source§

fn cancel_workflow_with_retries<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, cancelled_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<CancelOutcome, DbErrorWrite>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Request cancellation of a cancellable workflow, retrying the version-guarded transaction on the live-worker race.
Source§

impl DbExternalApi for SqlitePool

Source§

fn get_backtrace<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, filter: BacktraceFilter, ) -> Pin<Box<dyn Future<Output = Result<BacktraceInfo, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the latest backtrace if version is not set.
Source§

fn upsert_source_mapping<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, component_digest: &'life1 ComponentDigest, frame_key: &'life2 str, is_suffix: bool, digest: &'life3 ContentDigest, ) -> Pin<Box<dyn Future<Output = Result<(), DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Map a backtrace source file (a blob already stored in the CAS) to a component digest. frame_key is either an exact frame symbol path or a suffix (with leading /) when is_suffix is true. Repeated calls replace the digest mapped to the same key. The blob bytes themselves live in the CAS (see crate::cas::Cas); only this mapping lives in the database.
Source§

fn resolve_source_digest<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, component_digest: &'life1 ComponentDigest, file: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<ContentDigest>, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Resolve a backtrace source file’s CAS digest by component digest and a frame symbol path. Matches either exact keys or suffix keys (where the frame path ends with the stored key). Returns None if not found or if multiple suffix entries match (ambiguous). The caller fetches the bytes from the CAS (see crate::cas::Cas).
Source§

fn upsert_component_metadata<'life0, 'async_trait>( &'life0 self, records: Vec<ComponentMetadataRecord>, ) -> Pin<Box<dyn Future<Output = Result<(), DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Insert or reuse normalized component metadata rows.
Source§

fn insert_deployment_components<'life0, 'async_trait>( &'life0 self, deployment_id: DeploymentId, records: Vec<DeploymentComponentRecord>, ) -> Pin<Box<dyn Future<Output = Result<(), DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Insert deployment-local component bindings for a deployment.
Source§

fn list_deployment_components<'life0, 'async_trait>( &'life0 self, deployment_id: DeploymentId, ) -> Pin<Box<dyn Future<Output = Result<Vec<DeploymentComponentDetail>, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all components visible in a deployment, including persisted imports, exports and WIT.
Source§

fn get_deployment_component_wit<'life0, 'life1, 'async_trait>( &'life0 self, deployment_id: DeploymentId, component_digest: &'life1 ComponentDigest, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the WIT for a component digest scoped to a deployment.
Source§

fn list_executions<'life0, 'async_trait>( &'life0 self, filter: ListExecutionsFilter, pagination: ExecutionListPagination, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExecutionWithState>, DbErrorGeneric>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns executions sorted in descending order.
Source§

fn list_execution_events<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, pagination: Pagination<VersionType>, include_backtrace_id: bool, ) -> Pin<Box<dyn Future<Output = Result<ListExecutionEventsResponse, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns execution events for the given execution. Read more
Source§

fn list_responses_filtered<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, pagination: Pagination<u32>, join_set: Option<&'life2 JoinSetId>, ) -> Pin<Box<dyn Future<Output = Result<ListResponsesResponse, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn list_execution_events_responses<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, req_since: &'life2 Version, req_max_length: VersionType, req_include_backtrace_id: bool, resp_pagination: Pagination<u32>, ) -> Pin<Box<dyn Future<Output = Result<ExecutionWithStateRequestsResponses, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn upgrade_execution_component<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, old: &'life2 ComponentDigest, new: &'life3 ComponentDigest, reason: ComponentUpgradeReason, ) -> Pin<Box<dyn Future<Output = Result<(), DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn list_logs<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, show_derived: bool, filter: LogFilter, pagination: Pagination<LogCursor>, ) -> Pin<Box<dyn Future<Output = Result<ListLogsResponse, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn list_deployment_states<'life0, 'async_trait>( &'life0 self, current_time: DateTime<Utc>, pagination: Pagination<Option<DeploymentId>>, include_deployment_toml: bool, execution_counts: DeploymentExecutionCounts, ) -> Pin<Box<dyn Future<Output = Result<Vec<DeploymentState>, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn insert_deployment_with_components<'life0, 'async_trait>( &'life0 self, record: DeploymentRecord, component_metadata: Vec<ComponentMetadataRecord>, deployment_components: Vec<DeploymentComponentRecord>, deployment_component_files: Vec<DeploymentComponentFileRecord>, ) -> Pin<Box<dyn Future<Output = Result<(), DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Insert a new deployment row together with its component metadata and component rows in a single transaction, so the deployment row and its component rows commit together or not at all. The record must have status == Inactive and last_active_at == None; activation is a separate step via Self::activate_deployment.
Source§

fn missing_digests<'life0, 'async_trait>( &'life0 self, deployment_id: DeploymentId, ) -> Pin<Box<dyn Future<Output = Result<Vec<ContentDigest>, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return deployment file digests referenced by this deployment but absent from the CAS. Read more
Source§

fn list_deployment_files<'life0, 'async_trait>( &'life0 self, deployment_id: DeploymentId, ) -> Pin<Box<dyn Future<Output = Result<Vec<DeploymentFileRecord>, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the deployment-owned file refs recorded for a deployment.
Source§

fn gc_orphan_files<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete content-addressed file blobs not referenced by any stored deployment, returning the number deleted. Such orphans are left behind when a submit writes blobs to the store and then fails verification before persisting the deployment.
Source§

fn activate_deployment<'life0, 'async_trait>( &'life0 self, deployment_id: DeploymentId, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<(), DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn enqueue_deployment<'life0, 'async_trait>( &'life0 self, deployment_id: DeploymentId, ) -> Pin<Box<dyn Future<Output = Result<EnqueueOutcome, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Mark a deployment as Enqueued (pending next server restart). Any previously Enqueued deployment is demoted to Inactive. If the target deployment is currently Active, it remains Active and any previously Enqueued deployment is cleared. The returned EnqueueOutcome reflects which of those happened.
Source§

fn get_deployment<'life0, 'async_trait>( &'life0 self, deployment_id: DeploymentId, ) -> Pin<Box<dyn Future<Output = Result<Option<DeploymentRecord>, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returned DeploymentRecord must contain deployment_toml.
Source§

fn get_current_deployment<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<DeploymentRecord>, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the most relevant current deployment: Enqueued if present, otherwise Active. Returned DeploymentRecord must contain deployment_toml.
Source§

fn list_deployments<'life0, 'async_trait>( &'life0 self, pagination: Pagination<Option<DeploymentId>>, ) -> Pin<Box<dyn Future<Output = Result<Vec<DeploymentRecord>, DbErrorRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn pause_execution<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, paused_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<AppendResponse, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Pause an execution. If the execution is an activity and is currently in PendingState::Locked, implementations must reject the write, otherwise a running activity will be considered terminated, which can break structured concurrency guarantees.
Source§

fn unpause_execution<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, unpaused_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<AppendResponse, DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unpause an execution. Only paused executions can be unpaused.
Source§

fn pause_delay<'life0, 'life1, 'async_trait>( &'life0 self, delay_id: &'life1 DelayId, ) -> Pin<Box<dyn Future<Output = Result<(), DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Pause a delay, preventing it from being picked up by the expired timers watcher. No-op if the delay is already paused. Returns NotFound if the delay does not exist (already processed or cancelled).
Source§

fn unpause_delay<'life0, 'life1, 'async_trait>( &'life0 self, delay_id: &'life1 DelayId, ) -> Pin<Box<dyn Future<Output = Result<(), DbErrorWrite>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unpause a previously paused delay. No-op if the delay is already unpaused. Returns NotFound if the delay does not exist (already processed or cancelled).
Source§

fn list_responses<'life0, 'life1, 'async_trait>( &'life0 self, execution_id: &'life1 ExecutionId, pagination: Pagination<u32>, ) -> Pin<Box<dyn Future<Output = Result<ListResponsesResponse, DbErrorRead>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Returns responses of an execution ordered as they arrived, enabling matching each JoinNext to its corresponding response. Read more
Source§

impl DbPool for SqlitePool

Source§

fn db_exec_conn<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn DbExecutor>, DbErrorGeneric>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn connection<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn DbConnection>, DbErrorGeneric>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn external_api_conn<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn DbExternalApi>, DbErrorGeneric>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn cas_conn<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Cas>, DbErrorGeneric>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Content-addressed blob store for deployment files. Separate from the metadata connections so the bytes can move to an object store (S3) in future while the referencing metadata stays in the database.
Source§

impl DbPoolCloseable for SqlitePool

Source§

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl Drop for SqlitePool

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more