internal

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PgversionEmbeddedpostgres = embeddedpostgres.V18
)

IMPORTANT: Keep these in sync so that the major versions match.

Variables

View Source
var (
	RegexpMigrationName     = regexp.MustCompile(`^` + regexpPartialLowerKebabCase + `$`)
	RegexpMigrationFileName = regexp.MustCompile(`^\d{3}_` + regexpPartialLowerKebabCase + `\.up\.sql$`)
)

Functions

func Diff

func Diff(ctx context.Context, postgresConn, fromConn, toConn *pgx.Conn) (string, error)

Diff generates a SQL script to migrate the schema from the 'from' database to match the 'to' database. nolint:gocognit,cyclop

func ExecuteConfigTemplate

func ExecuteConfigTemplate(ts configuration.Template, version uint) (*string, error)

func FindMigrations

func FindMigrations(migrationsDir string, strict bool) ([]string, error)

func GetMigrationFileName

func GetMigrationFileName(migrationNumber uint, migrationName string) string

func GetMigrationsDir

func GetMigrationsDir(wd string) (string, error)

func GetNewMigrationFilePath

func GetNewMigrationFilePath(
	migrationsDir string,
	migrationsCount uint,
	migrationName string,
	overwrite bool,
) (
	path string,
	migrationNumber uint,
	err error,
)

func InitializeFlags

func InitializeFlags(cmd *cobra.Command)

func MarkFlagRequired

func MarkFlagRequired(cmd *cobra.Command, flag string)

func PgmodelerExportPNG added in v0.12.0

func PgmodelerExportPNG(ctx context.Context, input, output string) error

func PgmodelerExportSQL added in v0.12.0

func PgmodelerExportSQL(ctx context.Context, input, output string) error

func PgmodelerExportSVG added in v0.12.0

func PgmodelerExportSVG(ctx context.Context, input, output string) error

func RunHook

func RunHook(ctx context.Context, wd, hookName string, options *HookOptions) error

Types

type HookOptions

type HookOptions struct {
	Args []string
	Env  map[string]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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