db

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package db owns postgres connection setup and the backend's immutable migration history.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateUp

func MigrateUp(pool *sql.DB) error

MigrateUp preserves the existing schema_migrations ledger and pool ownership.

func Open

func Open(pool *sql.DB) (*gorm.DB, error)

Open wraps a caller-owned pool. It never changes ownership or creates schema.

Types

type Store

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

Store binds generated queries to one worker's connection, never a global query.

func New

func New(pool *sql.DB, worker string, options *backend.Options) (*Store, error)

func (*Store) CancelWorkflowInstance

func (s *Store) CancelWorkflowInstance(ctx context.Context, instance *core.WorkflowInstance, event *history.Event) error

func (*Store) Close

func (s *Store) Close() error

Close leaves the pool lifecycle with the backend constructor.

func (*Store) CompleteActivityTask

func (s *Store) CompleteActivityTask(ctx context.Context, task *backend.ActivityTask, result *history.Event) error

func (*Store) CompleteWorkflowTask

func (s *Store) CompleteWorkflowTask(
	ctx context.Context, task *backend.WorkflowTask, state core.WorkflowInstanceState,
	executed, activities, timers []*history.Event, workflowEvents []*history.WorkflowEvent,
) error

func (*Store) CreateWorkflowInstance

func (s *Store) CreateWorkflowInstance(ctx context.Context, instance *core.WorkflowInstance, event *history.Event) error

func (*Store) ExtendActivityTask

func (s *Store) ExtendActivityTask(ctx context.Context, task *backend.ActivityTask) error

func (*Store) ExtendWorkflowTask

func (s *Store) ExtendWorkflowTask(ctx context.Context, task *backend.WorkflowTask) error

func (*Store) FeatureSupported

func (s *Store) FeatureSupported(backend.Feature) bool

func (*Store) GetActivityTask

func (s *Store) GetActivityTask(ctx context.Context, queues []core.Queue) (*backend.ActivityTask, error)

func (*Store) GetFutureEvents

func (s *Store) GetFutureEvents(ctx context.Context) ([]*history.Event, error)

func (*Store) GetStats

func (s *Store) GetStats(ctx context.Context) (*backend.Stats, error)

func (*Store) GetWorkflowInstance

func (s *Store) GetWorkflowInstance(ctx context.Context, instance *core.WorkflowInstance) (*diag.WorkflowInstanceRef, error)

func (*Store) GetWorkflowInstanceHistory

func (s *Store) GetWorkflowInstanceHistory(ctx context.Context, instance *core.WorkflowInstance, after *int64) ([]*history.Event, error)

func (*Store) GetWorkflowInstanceState

func (s *Store) GetWorkflowInstanceState(ctx context.Context, instance *core.WorkflowInstance) (core.WorkflowInstanceState, error)

func (*Store) GetWorkflowInstances

func (s *Store) GetWorkflowInstances(ctx context.Context, afterID, afterExecutionID string, count int) ([]*diag.WorkflowInstanceRef, error)

func (*Store) GetWorkflowTask

func (s *Store) GetWorkflowTask(ctx context.Context, queues []core.Queue) (*backend.WorkflowTask, error)

func (*Store) GetWorkflowTree

func (s *Store) GetWorkflowTree(ctx context.Context, instance *core.WorkflowInstance) (*diag.WorkflowInstanceTree, error)

func (*Store) Metrics

func (s *Store) Metrics() metrics.Client

func (*Store) Options

func (s *Store) Options() *backend.Options

func (*Store) PrepareActivityQueues

func (s *Store) PrepareActivityQueues(context.Context, []core.Queue) error

func (*Store) PrepareWorkflowQueues

func (s *Store) PrepareWorkflowQueues(context.Context, []core.Queue) error

func (*Store) RemoveWorkflowInstance

func (s *Store) RemoveWorkflowInstance(ctx context.Context, instance *core.WorkflowInstance) error

func (*Store) RemoveWorkflowInstances

func (s *Store) RemoveWorkflowInstances(ctx context.Context, options ...backend.RemovalOption) error

func (*Store) SignalWorkflow

func (s *Store) SignalWorkflow(ctx context.Context, instanceID string, event *history.Event) error

func (*Store) Tracer

func (s *Store) Tracer() trace.Tracer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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