migo

package module
v0.0.0-...-ab9c142 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: MIT Imports: 9 Imported by: 0

README

migo Tests

A sql db migrations library for go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *sql.DB, fsys fs.FS) error

Migrate is equivalent to calling MigrateCtx(context.TODO(), db, fsys)

func MigrateCtx

func MigrateCtx(ctx context.Context, db *sql.DB, fsys fs.FS) error

MigrateCtx takes a fs.FS containing sql files and runs all .sql files not ending with _rollback.sql on the provided db. Migration files should begin with an integer, optionally followed by an underscore and a description, and end with .sql. Migration files must not end with _rollback.sql

func Purge

func Purge(db *sql.DB) error

Purge is equivalent to calling PurgeCtx(context.TODO(), db)

func PurgeCtx

func PurgeCtx(ctx context.Context, db *sql.DB) error

PurgeCtx deletes all migo specific information from the db, leaving previously run migrations intact

Types

This section is empty.

Jump to

Keyboard shortcuts

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