dbmigrate

package
v0.10.13 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(schemas []string, dbtyp config.DBType, cfg *DatabaseConfig, opt *MigrateOption) (migrated bool, err error)

Migrate applies the schema changes to the database. It returns true if any changes were applied (or would be applied in dry-run mode), and false if the database schema is already up-to-date.

Types

type DatabaseConfig

type DatabaseConfig struct {
	Database string
	Username string
	Password string
	Host     string
	Port     int
	SSLMode  string
}

type MigrateOption

type MigrateOption struct {
	Schemas    []string
	DryRun     bool
	EnableDrop bool
}

type SchemaDumper

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

func NewSchemaDumper

func NewSchemaDumper() (*SchemaDumper, error)

func (*SchemaDumper) Close

func (s *SchemaDumper) Close() (err error)

func (*SchemaDumper) Dump

func (s *SchemaDumper) Dump(driver config.DBType, dst ...any) (string, error)

Jump to

Keyboard shortcuts

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