Documentation ¶
Overview ¶
Package command provides helpers to create a binary / command from a migration sequence.
Index ¶
Constants ¶
const ( // EnvVarMySQLPassword is the environment variable used to supply a MySQL // password. Due to the sensitive nature of passwords, we don't support a // `--password` flag for passing along a password in plain text. EnvVarMySQLPassword = "DB_PASSWORD" )
const ( // EnvVarPostgresPassword is the environment variable officially supported by // `psql` for a password. Due to the sensitive nature of passwords, we // don't support a `--password` flag for passing along a password in plain // text. EnvVarPostgresPassword = "PGPASSWORD" )
Variables ¶
This section is empty.
Functions ¶
func MakeRootCommand ¶
func MakeRootCommand(rm RegisterMigrations) (*cobra.Command, error)
MakeRootCommand creates a `cobra` command that is bound to a sequence of migrations. The flags for the root command and relevant subcommands will be used to configure a `Manager`.
Types ¶
type RegisterMigrations ¶
type RegisterMigrations = func(sqlDirectory, engine string) (*golembic.Migrations, error)
RegisterMigrations defines a function interface that registers an entire sequence of migrations. The inputs are a directory where `.sql` files may be stored and the database engine (i.e. `postgres` or `mysql`). Functions satisfying this interface are intended to be used to lazily create migrations after flag parsing provides the SQL directory and engine as input.
type RoundDuration ¶
RoundDuration wraps a `time.Duration` as a value that can be used as flag with `cobra` / `pflag`, but one that must be convertible to a multiple of some base duration.
func (*RoundDuration) Set ¶
func (rd *RoundDuration) Set(value string) error
Set sets the duration based on a string input.
func (*RoundDuration) String ¶
func (rd *RoundDuration) String() string
String is the string representation of the stored value.
func (*RoundDuration) Type ¶
func (*RoundDuration) Type() string
Type is a human readable "description" of the underlying type being represented.