migrate

package
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Down

func Down(db *sql.DB, dialect Dialect, path string) error

Down rolls back a single migration from the current version

func DownPg

func DownPg(pool *pgxpool.Pool, path string) error

Down rolls back a single postgres migration from the current version.

func DownPgTo

func DownPgTo(pool *pgxpool.Pool, path string, version int64) error

DownTo rolls back postgres migrations to a specific version.

func DownTo

func DownTo(db *sql.DB, dialect Dialect, path string, version int64) error

DownTo rolls back migrations to a specific version.

func Migrate

func Migrate(db *sql.DB, dialect Dialect, path string) error

Migrate applies all pending database migrations to the specified database.

func MigratePg

func MigratePg(pool *pgxpool.Pool, path string) error

MigratePg applies all pending postgres migrations.

Types

type Dialect

type Dialect string
const (
	Postgres   Dialect = "postgres"
	Mysql      Dialect = "mysql"
	Sqlite3    Dialect = "sqlite3"
	Mssql      Dialect = "mssql"
	Redshift   Dialect = "redshift"
	TiDB       Dialect = "tidb"
	ClickHouse Dialect = "clickhouse"
)

Jump to

Keyboard shortcuts

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