Package riverprosqlite provides a River Pro driver implementation for SQLite on top of River's riversqlite driver. In addition to SQLite, the driver is tested against local libSQL and Turso databases.
SQLite has one database-wide writer reservation instead of PostgreSQL's row-level locks and SKIP LOCKED. Operations whose correctness depends on a locked read reserve the writer before reading; try-lock operations report contention as skipped, while other operations wait until the writer becomes available or their context is canceled. SQLite also has no transaction-local statement timeout, so workflow evaluation uses a context deadline.
This section is empty.
This section is empty.
This section is empty.
type Driver struct {
riversqlite.Driver
// contains filtered or unexported fields
}
Driver is an implementation of riverdriver.Driver for SQLite.
New returns a new SQLite-compatible driver for use with River Pro. The database pool may be backed by SQLite, local libSQL, or local Turso.
func (d *Driver) GetExecutor() riverdriver.Executor
func (d *Driver) GetProExecutor() driver.ProExecutor
func (d *Driver) PluginInit(archetype *baseservice.Archetype)
PluginInit initializes a plugin with an archetype It's invoked on Client.NewClient.
func (d *Driver) PluginPilot() riverpilot.Pilot
func (d *Driver) ProConfigInit(pilot riverpilot.Pilot)
func (d *Driver) UnwrapExecutor(tx *sql.Tx) riverdriver.ExecutorTx
func (d *Driver) UnwrapProExecutor(tx *sql.Tx) driver.ProExecutorTx
func (d *Driver) UnwrapTx(execTx riverdriver.ExecutorTx) *sql.Tx
type Executor struct {
*riversqlite.Executor
// contains filtered or unexported fields
}
func (e *Executor) Begin(ctx context.Context) (riverdriver.ExecutorTx, error)
func (e *Executor) JobInsertFastMany(ctx context.Context, params *riverdriver.JobInsertFastManyParams) ([]*riverdriver.JobInsertFastResult, error)
func (e *Executor) JobInsertFastManyNoReturning(ctx context.Context, params *riverdriver.JobInsertFastManyParams) (int, error)
func (e *Executor) PeriodicJobGetAll(ctx context.Context, params *driver.PeriodicJobGetAllParams) ([]*driver.PeriodicJob, error)
func (e *Executor) PeriodicJobGetByID(ctx context.Context, params *driver.PeriodicJobGetByIDParams) (*driver.PeriodicJob, error)
func (e *Executor) PeriodicJobInsert(ctx context.Context, params *driver.PeriodicJobInsertParams) (*driver.PeriodicJob, error)
func (e *Executor) PeriodicJobKeepAliveAndReap(ctx context.Context, params *driver.PeriodicJobKeepAliveAndReapParams) ([]*driver.PeriodicJob, error)
func (e *Executor) PeriodicJobUpsertMany(ctx context.Context, params *driver.PeriodicJobUpsertManyParams) ([]*driver.PeriodicJob, error)
func (e *Executor) ProducerListByQueue(ctx context.Context, params *driver.ProducerListByQueueParams) ([]*driver.ProducerListByQueueResult, error)
func (e *Executor) QueueGetMetadataForInsert(ctx context.Context, params *driver.QueueGetMetadataForInsertParams) ([]*driver.QueueGetMetadataForInsertResult, error)
func (e *Executor) SequencePromote(ctx context.Context, params *driver.SequencePromoteParams) (*driver.SequencePromoteResult, error)
func (e *Executor) SequencePromoteFromTable(ctx context.Context, params *driver.SequencePromoteFromTableParams) (*driver.SequencePromoteFromTableResult, error)
func (e *Executor) SequenceScanAndPromoteStalled(ctx context.Context, params *driver.SequenceScanAndPromoteStalledParams) (*driver.SequenceScanAndPromoteStalledResult, error)
SetLocalStatementTimeout is a no-op because SQLite has no equivalent of PostgreSQL's transaction-local `SET LOCAL statement_timeout`. Evaluator transactions consult SupportsLocalStatementTimeout and enforce this with a context deadline instead.
func (e *Executor) WorkflowAttemptInsert(ctx context.Context, params *driver.WorkflowAttemptInsertParams) (*driver.WorkflowAttempt, error)
func (e *Executor) WorkflowAttemptListByWorkflowID(ctx context.Context, params *driver.WorkflowAttemptListByWorkflowIDParams) ([]*driver.WorkflowAttempt, error)
func (e *Executor) WorkflowAttemptTaskInsert(ctx context.Context, params *driver.WorkflowAttemptTaskInsertParams) (*driver.WorkflowAttemptTask, error)
func (e *Executor) WorkflowAttemptTaskListByWorkflowID(ctx context.Context, params *driver.WorkflowAttemptTaskListByWorkflowIDParams) ([]*driver.WorkflowAttemptTask, error)
func (e *Executor) WorkflowJobList(ctx context.Context, params *driver.WorkflowJobListParams) ([]*driver.WorkflowTaskWithJob, error)
func (e *Executor) WorkflowListActive(ctx context.Context, params *driver.WorkflowListParams) ([]*driver.WorkflowListItem, error)
func (e *Executor) WorkflowListAll(ctx context.Context, params *driver.WorkflowListParams) ([]*driver.WorkflowListItem, error)
func (e *Executor) WorkflowListByIDsForWaitEval(ctx context.Context, params *driver.WorkflowListByIDsForWaitEvalParams) ([]*driver.WorkflowWaitWorkflow, error)
func (e *Executor) WorkflowListInactive(ctx context.Context, params *driver.WorkflowListParams) ([]*driver.WorkflowListItem, error)
func (e *Executor) WorkflowLoadJobsWithDeps(ctx context.Context, params *driver.WorkflowLoadJobsWithDepsParams) ([]*driver.WorkflowTaskWithJob, error)
func (e *Executor) WorkflowLoadTaskWithDeps(ctx context.Context, params *driver.WorkflowLoadTaskWithDepsParams) (*driver.WorkflowTaskWithJob, error)
func (e *Executor) WorkflowLoadTasksByNames(ctx context.Context, params *driver.WorkflowLoadTasksByNamesParams) ([]*driver.WorkflowTask, error)
func (e *Executor) WorkflowReadyTaskIDsByWorkflowIDs(ctx context.Context, params *driver.WorkflowReadyTaskIDsByWorkflowIDsParams) ([]*driver.WorkflowReadyTaskIDsByWorkflowIDsRow, error)
func (e *Executor) WorkflowRetryLockAndCheckRunning(ctx context.Context, params *driver.WorkflowRetryLockAndCheckRunningParams) (*driver.WorkflowRetryLockAndCheckRunningResult, error)
func (e *Executor) WorkflowSignalInsert(ctx context.Context, params *driver.WorkflowSignalInsertParams) (*driver.WorkflowSignalInsertResult, error)
func (e *Executor) WorkflowSignalList(ctx context.Context, params *driver.WorkflowSignalListParams) ([]*driver.WorkflowSignal, error)
func (e *Executor) WorkflowSignalListByEvidence(ctx context.Context, params *driver.WorkflowSignalListByEvidenceParams) ([]*driver.WorkflowSignal, error)
func (e *Executor) WorkflowSignalListByKeys(ctx context.Context, params *driver.WorkflowSignalListByKeysParams) ([]*driver.WorkflowSignal, error)
func (e *Executor) WorkflowSignalListByWorkflowIDs(ctx context.Context, params *driver.WorkflowSignalListByWorkflowIDsParams) ([]*driver.WorkflowSignal, error)
func (e *Executor) WorkflowSignalStatsByWorkflowIDs(ctx context.Context, params *driver.WorkflowSignalStatsByWorkflowIDsParams) ([]*driver.WorkflowSignalStat, error)
func (e *Executor) WorkflowTimerConsumeDue(ctx context.Context, params *driver.WorkflowTimerConsumeDueParams) ([]*driver.WorkflowTimer, error)
func (e *Executor) WorkflowTimerGetByWorkflowID(ctx context.Context, params *driver.WorkflowTimerGetByWorkflowIDParams) (*driver.WorkflowTimer, error)
func (e *Executor) WorkflowTimerNextFireAtByWorkflowIDs(ctx context.Context, params *driver.WorkflowTimerNextFireAtByWorkflowIDsParams) ([]*driver.WorkflowTimerNextFireAtByWorkflowIDsRow, error)
func (e *Executor) WorkflowWaitActivatableTaskIDsByWorkflowIDs(ctx context.Context, params *driver.WorkflowWaitActivatableTaskIDsByWorkflowIDsParams) ([]*driver.WorkflowWaitActivatableTaskIDsByWorkflowIDsRow, error)
func (e *Executor) WorkflowWaitActiveTaskListByWorkflowIDs(ctx context.Context, params *driver.WorkflowWaitActiveTaskListByWorkflowIDsParams) ([]*driver.WorkflowWaitActiveTask, error)
func (e *Executor) WorkflowWaitDepOutputListByWorkflowTaskPairs(ctx context.Context, params *driver.WorkflowWaitDepOutputListByWorkflowTaskPairsParams) ([]*driver.WorkflowWaitDepOutput, error)
func (e *Executor) WorkflowWorklistDeleteByWorkflowIDsReturningReasons(ctx context.Context, params *driver.WorkflowWorklistDeleteByWorkflowIDsReturningReasonsParams) ([]*driver.WorkflowWorklistDeleteByWorkflowIDsReturningReasonsRow, error)
func (e *Executor) WorkflowWorklistList(ctx context.Context, params *driver.WorkflowWorklistListParams) ([]*driver.WorkflowWorklistItem, error)
func (e *Executor) WorkflowWorklistListIDs(ctx context.Context, params *driver.WorkflowWorklistListParams) ([]*driver.WorkflowWorklistIDItem, error)
type ExecutorSubTx struct {
Executor
// contains filtered or unexported fields
}
func (t *ExecutorSubTx) Begin(ctx context.Context) (riverdriver.ExecutorTx, error)
func (t *ExecutorSubTx) BeginPro(ctx context.Context) (driver.ProExecutorTx, error)
func (t *ExecutorSubTx) Commit(ctx context.Context) error
func (t *ExecutorSubTx) Rollback(ctx context.Context) error
type ExecutorTx struct {
Executor
// contains filtered or unexported fields
}
func (t *ExecutorTx) Begin(ctx context.Context) (riverdriver.ExecutorTx, error)
func (t *ExecutorTx) BeginPro(ctx context.Context) (driver.ProExecutorTx, error)
func (t *ExecutorTx) Commit(ctx context.Context) error
func (t *ExecutorTx) Rollback(ctx context.Context) error