migrator

package
v0.0.0-...-3c68a0f Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string
	Port     int
	Username string
	Password string
	DBName   string
	SSLMode  string
}

type Migrate

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

func New

func New(cfg Config, path string) Migrate

func (Migrate) Close

func (m Migrate) Close() error

Close DB connection.

func (Migrate) Down

func (m Migrate) Down(maxM int) (int, error)

Down migrate Will apply at most `max` migrations. Pass 0 for no limit (or use Exec).

func (Migrate) Up

func (m Migrate) Up(maxM int) (int, error)

Up migrate Will apply at most `max` migrations. Pass 0 for no limit (or use Exec).

Jump to

Keyboard shortcuts

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