migrations

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClickhouseDB

func GetClickhouseDB(config ClickhouseConfig) *sql.DB

GetClickhouseDB returns a sql.DB connection to clickhouse.

func RunGoose

func RunGoose(ctx context.Context, gooseArgs []string, db *sql.DB) error

RunGoose runs the goose command with the provided arguments. args should be the command and the arguments to pass to goose. eg RunGoose(ctx, []string{"up", "-v"}, db).

func SetMigrations

func SetMigrations()

SetMigrations sets the migrations for the goose tool. this will reset the global migrations and FS to avoid any unwanted migrations registers.

Types

type ClickhouseConfig

type ClickhouseConfig struct {
	Host     string `yaml:"CLICKHOUSE_HOST"`
	Port     string `yaml:"CLICKHOUSE_PORT"`
	User     string `yaml:"CLICKHOUSE_USER"`
	Password string `yaml:"CLICKHOUSE_PASSWORD"`
	DataBase string `yaml:"CLICKHOUSE_DATABASE"`
}

ClickhouseConfig is the configuration for connecting to a clickhouse database.

Jump to

Keyboard shortcuts

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