migrator

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Overview

Package migrator provides utilities for database migration management.

Index

Constants

View Source
const (
	DefaultOption option = iota
	MigratorOption
)

Define values for [option].

Variables

View Source
var (
	ErrExecSQL     = errors.New("locking: failed to execute SQL")
	ErrAcquireLock = errors.New("locking: failed to acquire advisory lock")
	ErrReleaseLock = errors.New("locking: failed to release advisory lock")
)

Errors returned when acquiring or releasing advisory locks.

Functions

func GenerateLockKey

func GenerateLockKey(s string) int64

GenerateLockKey generates a lock key from a string.

func OptionFromDB

func OptionFromDB(db *gorm.DB) (option, error)

OptionFromDB retrieves the migration option from the database. If the option is not found or is not of the correct type, it returns driver.ErrInvalidMigration.

func WithOption

func WithOption(opt option) func(*gorm.DB) *gorm.DB

WithOption sets the migration option for the database.

Types

This section is empty.

Jump to

Keyboard shortcuts

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