raincli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadSchemaSnapshot

func LoadSchemaSnapshot(ctx context.Context, cwd string, config Config) (migrator.Snapshot, error)

LoadSchemaSnapshot shells out to a generated helper so user schema packages can stay regular Go code.

func Main

func Main()

Main is a thin wrapper around Run for cmd/rain.

func Run

func Run(ctx context.Context, cwd string, args []string, stdout, stderr io.Writer) error

Run executes the rain CLI.

Types

type Config

type Config struct {
	Dialect        string `yaml:"dialect"`
	SchemaPackage  string `yaml:"schema_package"`
	SchemaFunction string `yaml:"schema_function"`
	Out            string `yaml:"out"`
	MigrationTable string `yaml:"migration_table"`
	DSN            string `yaml:"dsn"`
}

Config defines the CLI settings loaded from disk and flags.

func LoadConfig

func LoadConfig(cwd string, options Options) (Config, error)

LoadConfig reads and merges one command configuration.

type Options

type Options struct {
	ConfigPath     string
	Dialect        string
	SchemaPackage  string
	SchemaFunction string
	Out            string
	MigrationTable string
	DSN            string
}

Options are one-command overrides layered on top of config file settings.

Jump to

Keyboard shortcuts

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