dbmigrate

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 6 Imported by: 0

README

db-migrate-postgres

Simple library to handle database schema changes automatically

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(cfg Config) (err error)

func RollbackOnError

func RollbackOnError(tx *sql.Tx, err error) error

Types

type Config

type Config struct {
	Database       *sql.DB
	DatabaseSchema string
	ScriptsFolder  string
	Migrations     []Migration
	Log            *slog.Logger
}

type Migration

type Migration struct {
	Version      int
	SQLStatement string
}

Jump to

Keyboard shortcuts

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