storedb

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDBPathRequired     = errors.New("database path is required")
	ErrModuleRequired     = errors.New("migration module is required")
	ErrOpenDB             = errors.New("open database")
	ErrOpenInitLock       = errors.New("open database init lock")
	ErrAcquireInitLock    = errors.New("acquire database init lock")
	ErrReleaseInitLock    = errors.New("release database init lock")
	ErrConfigureDB        = errors.New("configure database")
	ErrCreateMigrationTbl = errors.New("create schema_migrations table")
	ErrReadMigrations     = errors.New("read applied migrations")
	ErrDuplicateMigration = errors.New("duplicate migration version")
	ErrCreateBackup       = errors.New("create pre-migration backup")
	ErrApplyMigration     = errors.New("apply migration")
	ErrCommitMigration    = errors.New("commit migration")
	ErrRecordMigration    = errors.New("record migration")
	ErrRollbackRestore    = errors.New("restore database from backup")
	ErrRemoveBackup       = errors.New("remove migration backup")
	ErrCopyBackup         = errors.New("copy migration backup")
)

Functions

func Open

func Open(opts OpenOptions) (*sql.DB, error)

Types

type Migration

type Migration struct {
	Version int
	Name    string
	SQL     string
}

type OpenOptions

type OpenOptions struct {
	Path       string
	Module     string
	Migrations []Migration
}

Jump to

Keyboard shortcuts

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