migrator

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DIFF_MODE_CREATE_TABLE skips alter when the current table already exists.
	DIFF_MODE_CREATE_TABLE = diff.MODE_CREATE_TABLE
	// DIFF_MODE_DRY_RUN returns SQL without executing it.
	DIFF_MODE_DRY_RUN = diff.MODE_DRY_RUN
)

Variables

View Source
var (
	// CtxMode carries migration/diff mode flags.
	CtxMode = diff.CtxMode
	// CtxOutput is reserved for writing migration output to a directory.
	CtxOutput = contextx.NewT[string]()
)

Functions

func Migrate

func Migrate(ctx context.Context, a adaptor.Adaptor, next builder.Catalog) (string, error)

Migrate diffs curr catalog against next, appends SQL meta document statements, and executes them in a transaction unless DIFF_MODE_DRY_RUN is set. It returns the interpolated SQL script.

Types

type Mode added in v0.2.1

type Mode = diff.Mode

Mode is a migration/diff mode flag set.

Directories

Path Synopsis
Code generated by genx:model@(devel) DO NOT EDIT.
Code generated by genx:model@(devel) DO NOT EDIT.

Jump to

Keyboard shortcuts

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