db

package
v0.0.0-...-9cf9cea Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DBConfigOptionFlagName = "database-url"

Variables

This section is empty.

Functions

func ExecuteMigrations

func ExecuteMigrations(ctx context.Context, dbURL string, dir migrate.MigrationDirection, count int, migrationRouter migrations.MigrationRouter) error

ExecuteMigrations executes the migrations on the database, according with the direction, count and folder containing the migration files.

func MigrateCmd

func MigrateCmd(ctx context.Context, executeMigrationsFn func(ctx context.Context, dir migrate.MigrationDirection, count int) error) *cobra.Command

MigrateCmd returns a cobra.Command responsible for running the database migrations.

Types

type DatabaseCommand

type DatabaseCommand struct {
	// contains filtered or unexported fields
}

func (*DatabaseCommand) Command

func (c *DatabaseCommand) Command(globalOptions *utils.GlobalOptionsType) *cobra.Command

type SchemaMigrationManager

type SchemaMigrationManager struct {
	MigrationRouter   migrations.MigrationRouter
	SchemaName        string
	SchemaDatabaseDSN string
	// contains filtered or unexported fields
}

func NewSchemaMigrationManager

func NewSchemaMigrationManager(
	migrationRouter migrations.MigrationRouter,
	schemaName string,
	schemaDatabaseDSN string,
) (*SchemaMigrationManager, error)

func (*SchemaMigrationManager) Close

func (m *SchemaMigrationManager) Close() error

func (*SchemaMigrationManager) OrchestrateSchemaMigrations

func (m *SchemaMigrationManager) OrchestrateSchemaMigrations(ctx context.Context, dir migrate.MigrationDirection, count int) error

Jump to

Keyboard shortcuts

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