dbmigrate

package
v0.0.0-...-c4f087e Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Overview

Package dbmigrate provides the PostgreSQL migration mechanics shared by services while leaving each service in control of its migration streams, ledger names, queue schema, and surrounding bootstrap policy.

Index

Constants

This section is empty.

Variables

View Source
var ErrLockNotHeld = errors.New("database advisory lock was not held")

ErrLockNotHeld reports that PostgreSQL did not release the requested lock from the dedicated session that acquired it.

Functions

func NewGooseProvider

func NewGooseProvider(databaseConnection *sql.DB, migrations fs.FS, trackingTable string) (*goose.Provider, error)

NewGooseProvider creates a PostgreSQL Goose provider without changing Goose's package globals. The caller owns the migration stream and tracking table name.

func NewGooseStore

func NewGooseStore(trackingTable string) (database.Store, error)

NewGooseStore creates a PostgreSQL migration store using the caller's tracking table without changing Goose's package globals.

func NewRiverMigrator

func NewRiverMigrator[TTx any](driver riverdriver.Driver[TTx], schema string) (*rivermigrate.Migrator[TTx], error)

NewRiverMigrator creates a River migrator targeting an explicit schema.

func WithPostgresSessionLock

func WithPostgresSessionLock(
	ctx context.Context,
	databaseConnection *sql.DB,
	name string,
	operation func(context.Context) error,
) (err error)

WithPostgresSessionLock runs operation while holding a named PostgreSQL advisory lock. The lock is acquired and released on the same dedicated connection because advisory locks are scoped to a backend session.

Types

This section is empty.

Jump to

Keyboard shortcuts

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