sql

package
v0.0.0-...-bea47b1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialect

type Dialect interface {
	Placeholder(n int) string
	SkipLocked(query string) string
	Name() string
}

type MySQLDialect

type MySQLDialect struct{}

func (MySQLDialect) Name

func (d MySQLDialect) Name() string

func (MySQLDialect) Placeholder

func (d MySQLDialect) Placeholder(n int) string

func (MySQLDialect) SkipLocked

func (d MySQLDialect) SkipLocked(query string) string

type Options

type Options struct {
	TablePrefix string // e.g. "flow_" so tables become flow_workflows
	AutoMigrate bool   // default true when using constructors below
	VarHistory  bool   // reserved; history table optional
}

Options configures SQL storage table naming and migrations.

type PostgresDialect

type PostgresDialect struct{}

func (PostgresDialect) Name

func (d PostgresDialect) Name() string

func (PostgresDialect) Placeholder

func (d PostgresDialect) Placeholder(n int) string

func (PostgresDialect) SkipLocked

func (d PostgresDialect) SkipLocked(query string) string

type SQLStorage

type SQLStorage struct {
	// contains filtered or unexported fields
}

func NewSQLStorage

func NewSQLStorage(db *sqlx.DB, dialectName string) (*SQLStorage, error)

NewSQLStorage creates storage with auto-migrate and empty prefix (back-compat).

func NewSQLStorageFromDB

func NewSQLStorageFromDB(db *sql.DB, dialectName string, opts Options) (*SQLStorage, error)

NewSQLStorageFromDB wraps database/sql.DB via sqlx.

func NewSQLStorageWithOptions

func NewSQLStorageWithOptions(db *sqlx.DB, dialectName string, opts Options) (*SQLStorage, error)

NewSQLStorageWithOptions creates storage with custom options.

func (*SQLStorage) AppendCompensationRecord

func (s *SQLStorage) AppendCompensationRecord(ctx context.Context, namespace string, rec *models.CompensationRecord) error

func (*SQLStorage) ClaimReadyStep

func (s *SQLStorage) ClaimReadyStep(ctx context.Context, namespace string, workerID string) (*models.ExecutionStep, error)

func (*SQLStorage) CreateExecution

func (s *SQLStorage) CreateExecution(ctx context.Context, namespace string, exec *models.Execution) error

func (*SQLStorage) CreateExecutionStep

func (s *SQLStorage) CreateExecutionStep(ctx context.Context, namespace string, step *models.ExecutionStep) error

func (*SQLStorage) DeleteSchedule

func (s *SQLStorage) DeleteSchedule(ctx context.Context, namespace, id string) error

func (*SQLStorage) GetActiveSchedules

func (s *SQLStorage) GetActiveSchedules(ctx context.Context) ([]*models.Schedule, error)

func (*SQLStorage) GetExecution

func (s *SQLStorage) GetExecution(ctx context.Context, namespace string, id string) (*models.Execution, error)

func (*SQLStorage) GetExecutionStepByNode

func (s *SQLStorage) GetExecutionStepByNode(ctx context.Context, namespace, executionID, nodeID string) (*models.ExecutionStep, error)

func (*SQLStorage) GetExecutionSteps

func (s *SQLStorage) GetExecutionSteps(ctx context.Context, namespace string, executionID string) ([]*models.ExecutionStep, error)

func (*SQLStorage) GetSchedule

func (s *SQLStorage) GetSchedule(ctx context.Context, namespace, id string) (*models.Schedule, error)

func (*SQLStorage) GetWorkflow

func (s *SQLStorage) GetWorkflow(ctx context.Context, namespace string, id string) (*models.Workflow, error)

func (*SQLStorage) HeartbeatStep

func (s *SQLStorage) HeartbeatStep(ctx context.Context, namespace, stepID, workerID string) (bool, error)

HeartbeatStep extends the lease of a RUNNING step owned by workerID.

func (*SQLStorage) ListCompensationRecords

func (s *SQLStorage) ListCompensationRecords(ctx context.Context, namespace, executionID string) ([]*models.CompensationRecord, error)

func (*SQLStorage) ListExecutions

func (s *SQLStorage) ListExecutions(ctx context.Context, namespace string) ([]*models.Execution, error)

func (*SQLStorage) ListSchedules

func (s *SQLStorage) ListSchedules(ctx context.Context, namespace string, filter storage.ScheduleFilter) ([]*models.Schedule, error)

func (*SQLStorage) ListWaitingSteps

func (s *SQLStorage) ListWaitingSteps(ctx context.Context, namespace string, filter storage.TaskFilter) ([]*models.ExecutionStep, error)

func (*SQLStorage) ListWorkflows

func (s *SQLStorage) ListWorkflows(ctx context.Context, namespace string) ([]*models.Workflow, error)

func (*SQLStorage) RecordScheduleRun

func (s *SQLStorage) RecordScheduleRun(ctx context.Context, namespace, id string, fireAt time.Time, execID, lastErr string, nextRun *time.Time) error

func (*SQLStorage) RunMigrations

func (s *SQLStorage) RunMigrations() error

func (*SQLStorage) SaveSchedule

func (s *SQLStorage) SaveSchedule(ctx context.Context, sched *models.Schedule) error

func (*SQLStorage) SaveWorkflow

func (s *SQLStorage) SaveWorkflow(ctx context.Context, namespace string, wf *models.Workflow) error

func (*SQLStorage) SetEncryption

func (s *SQLStorage) SetEncryption(crypto *storage.Crypto)

func (*SQLStorage) TryClaimScheduleRun

func (s *SQLStorage) TryClaimScheduleRun(ctx context.Context, namespace, id string, fireAt time.Time) (bool, error)

func (*SQLStorage) UpdateExecution

func (s *SQLStorage) UpdateExecution(ctx context.Context, namespace string, exec *models.Execution) error

func (*SQLStorage) UpdateExecutionIf

func (s *SQLStorage) UpdateExecutionIf(ctx context.Context, namespace string, exec *models.Execution, from models.TaskStatus) (bool, error)

UpdateExecutionIf implements storage.ConditionalUpdater.

func (*SQLStorage) UpdateExecutionStep

func (s *SQLStorage) UpdateExecutionStep(ctx context.Context, namespace string, step *models.ExecutionStep) error

func (*SQLStorage) UpdateExecutionStepIf

func (s *SQLStorage) UpdateExecutionStepIf(ctx context.Context, namespace string, step *models.ExecutionStep, from models.TaskStatus, worker string) (bool, error)

UpdateExecutionStepIf implements storage.ConditionalUpdater.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL