stdmageatlas

package
v0.0.185 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package stdmageatlas provides mage commands for working with Atlas-based projects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply added in v0.0.51

func Apply(env string) error

Apply applies the migrations for the provided Atlas environment.

func Diff

func Diff(name string) error

Diff generates a named migration for the local environment.

func DryApply added in v0.0.77

func DryApply(env string) error

DryApply applies the migrations for the provided Atlas environment with the --dry-run flag.

func Hash

func Hash() error

Hash runs the logic for re-hashing the Atlas sum file.

func Init

func Init(
	localDevEnv string,
	atlasInspectEnv,
	atlasMigrationsDir string,
	snapshotRelDir string,
	snapshotTargetContainerName string,
	snapshotTargetConnStrEnvName string,
	snapshotDockerImageTag string,
	hook PatchFunc,
	_ ...[]string,
)

Init inits the mage targets. The weird signature is to make Mage ignore this when importing.

func Inspect

func Inspect() error

Inspect visualizes the schema.

func Iterate

func Iterate(name string) error

Iterate replaces the latest migration file with the same name, for quicker development.

func Snapshot added in v0.0.51

func Snapshot() error

Snapshot dumps the migrated schema to an sql file using pg_dump.

Types

type PatchFunc

type PatchFunc = func(latestName, latestFilename string) error

PatchFunc allows users of the mage targets to patch any migration that is generated.

Jump to

Keyboard shortcuts

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