roll

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VersionedSchemaName

func VersionedSchemaName(schema string, version string) string

Types

type Option added in v0.5.0

type Option func(*options)

func WithDisableViewsManagement added in v0.5.0

func WithDisableViewsManagement() Option

WithDisableViewsManagement disables pgroll version schemas management when passed, pgroll will not create or drop version schemas

func WithLockTimeoutMs added in v0.5.0

func WithLockTimeoutMs(lockTimeoutMs int) Option

WithLockTimeoutMs sets the lock timeout in milliseconds for pgroll DDL operations

func WithRole added in v0.5.0

func WithRole(role string) Option

WithRole sets the role to set before executing migrations

type PGVersion added in v0.4.0

type PGVersion int
const PGVersion15 PGVersion = 15

type Roll

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

func New

func New(ctx context.Context, pgURL, schema string, state *state.State, opts ...Option) (*Roll, error)

func (*Roll) Close

func (m *Roll) Close() error

func (*Roll) Complete

func (m *Roll) Complete(ctx context.Context) error

Complete will update the database schema to match the current version

func (*Roll) Init

func (m *Roll) Init(ctx context.Context) error

func (*Roll) PGVersion added in v0.4.0

func (m *Roll) PGVersion() PGVersion

func (*Roll) Rollback

func (m *Roll) Rollback(ctx context.Context) error

func (*Roll) Start

func (m *Roll) Start(ctx context.Context, migration *migrations.Migration, cbs ...migrations.CallbackFn) error

Start will apply the required changes to enable supporting the new schema version

func (*Roll) Status added in v0.4.1

func (m *Roll) Status(ctx context.Context, schema string) (*state.Status, error)

Jump to

Keyboard shortcuts

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