gormstore

package
v1.2.11 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package gormstore composes the workflow persistence interfaces over a caller-owned Gorm database. Database drivers and connection ownership remain the responsibility of the host application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, db *gorm.DB, opts Options) (*persist.Stores, error)

New creates all Gorm-backed stores. The supplied *gorm.DB remains caller-owned unless Options.Close explicitly transfers cleanup to the returned bundle. Constructors currently run Gorm AutoMigrate; production deployments should review migrations before startup.

Types

type Options

type Options struct {
	Credentials credential.Store
	Recovery    RecoveryMode
	// Close transfers connection ownership to the returned bundle when set.
	// Leave nil when the host application owns the connection pool.
	Close func() error
}

type RecoveryMode

type RecoveryMode string
const (
	// RecoveryDisabled is safe for shared databases because it does not mutate
	// runs that may be owned by another live process.
	RecoveryDisabled RecoveryMode = "disabled"
	// RecoveryFailInterrupted is only safe when this process is the exclusive
	// scheduler owner for the database.
	RecoveryFailInterrupted RecoveryMode = "fail_interrupted"
)

Jump to

Keyboard shortcuts

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