sqlmig

package module
v0.0.0-...-26cf2ba Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 5 Imported by: 0

README

sqlmig

Package sqlmig supports running embedded database/sql migrations.

Documentation

Overview

Package sqlmig supports running embedded database/sql migrations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
	BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
}

DB must be satisfied for executing migrations.

type Source

type Source struct {
	FS   fs.FS
	Glob string
}

Source defines a FS and correlated Glob to provide a source of migrations.

func (Source) Migrate

func (s Source) Migrate(ctx context.Context, db DB) error

Migrate runs the migrations on the target DB.

Jump to

Keyboard shortcuts

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