migrations

package
v0.0.0-...-4263410 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoMigrationsFound = errors.New("no migrations found")
	ErrMigration         = errors.New("unable to perform migration")
	ErrSeedProduction    = errors.New("seed in production")
)

Functions

func CallCallback

func CallCallback(ctx context.Context, seq int32) error

func HasCallback

func HasCallback(seq int32) bool

func Migrate

func Migrate(ctx context.Context, schema string) error

Migrate executes embedded SQL scripts from internal/db/migrations. For the time being only "up" migrations are supported. When this package is initialized, the directory is verified that it only contains XXX_*.up.sql files (XXX = numbers).

func Seed

func Seed(ctx context.Context, seedScript string) error

Seed executes embedded SQL scripts from internal/db/seeds

Types

type EmbeddedFS

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

func NewEmbeddedFS

func NewEmbeddedFS(fs *embed.FS) *EmbeddedFS

func (*EmbeddedFS) Glob

func (efs *EmbeddedFS) Glob(pattern string) (matches []string, err error)

func (*EmbeddedFS) Open

func (efs *EmbeddedFS) Open(name string) (fs.File, error)

func (*EmbeddedFS) ReadDir

func (efs *EmbeddedFS) ReadDir(dirname string) ([]fs.FileInfo, error)

func (*EmbeddedFS) ReadFile

func (efs *EmbeddedFS) ReadFile(filename string) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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