Documentation
¶
Overview ¶
Package cli provides a command-line interface for Queen migrations.
Index ¶
Constants ¶
View Source
const ( DriverPostgres = "postgres" DriverPostgreSQL = "postgresql" DriverMySQL = "mysql" DriverSQLite = "sqlite" DriverSQLite3 = "sqlite3" DriverClickHouse = "clickhouse" SQLDriverPostgres = "pgx" SQLDriverMySQL = "mysql" SQLDriverSQLite = "sqlite3" SQLDriverClickHouse = "clickhouse" )
View Source
const DefaultTableName = "queen_migrations"
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(register RegisterFunc)
Run starts the CLI with the given migration registration function.
func RunWithDB ¶
func RunWithDB(register RegisterFunc, dbOpener DBOpener)
RunWithDB starts the CLI with a custom database opener.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App holds the CLI application state.
type Config ¶
type Config struct {
Driver string `yaml:"driver"`
DSN string `yaml:"dsn"`
Table string `yaml:"table"`
LockTimeout time.Duration `yaml:"lock_timeout"`
UseConfig bool `yaml:"-"`
Env string `yaml:"-"`
UnlockProduction bool `yaml:"-"`
Yes bool `yaml:"-"`
JSON bool `yaml:"-"`
Verbose bool `yaml:"-"`
// contains filtered or unexported fields
}
Config holds all configuration options for the CLI.
type ConfigFile ¶
type ConfigFile struct {
ConfigLocked bool `yaml:"config_locked"`
Naming *NamingConfig `yaml:"naming"`
Environments map[string]*Environment `yaml:",inline"`
}
ConfigFile represents the structure of .queen.yaml
type DoctorResult ¶ added in v0.3.0
type DoctorResult struct {
Check string `json:"check"`
Status string `json:"status"` // "statusPass", "statusWarning", "statusFail"
Message string `json:"message"`
Details string `json:"details,omitempty"`
Severity string `json:"severity,omitempty"`
}
DoctorResult represents a health check result.
type Environment ¶
type Environment struct {
Driver string `yaml:"driver"`
DSN string `yaml:"dsn"`
Table string `yaml:"table"`
LockTimeout time.Duration `yaml:"lock_timeout"`
RequireConfirmation bool `yaml:"require_confirmation"`
RequireExplicitUnlock bool `yaml:"require_explicit_unlock"`
}
Environment represents a single environment configuration.
type NamingConfig ¶ added in v0.2.0
type NamingConfig struct {
Pattern string `yaml:"pattern"`
Padding int `yaml:"padding"`
Enforce *bool `yaml:"enforce"`
}
NamingConfig represents naming pattern configuration in YAML.
type RegisterFunc ¶
RegisterFunc is a function that registers migrations with Queen.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.