migration

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCallWithNewTransaction = errors.New("call with new transaction")

Functions

func MigrateIfNeeded

func MigrateIfNeeded(targetDB db.DB, network utils.Network, log utils.SimpleLogger) error

func SchemaVersion

func SchemaVersion(targetDB db.DB) (uint64, error)

Types

type BucketMigrator added in v0.5.0

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

func NewBucketMigrator added in v0.5.0

func NewBucketMigrator(target db.Bucket, do BucketMigratorDoFunc) *BucketMigrator

func NewBucketMover added in v0.5.0

func NewBucketMover(source, destination db.Bucket) *BucketMigrator

func (*BucketMigrator) Before added in v0.5.0

func (m *BucketMigrator) Before()

func (*BucketMigrator) Migrate added in v0.5.0

func (m *BucketMigrator) Migrate(txn db.Transaction, network utils.Network) error

func (*BucketMigrator) WithBatchSize added in v0.5.0

func (m *BucketMigrator) WithBatchSize(batchSize uint) *BucketMigrator

func (*BucketMigrator) WithBefore added in v0.5.0

func (m *BucketMigrator) WithBefore(before func()) *BucketMigrator

func (*BucketMigrator) WithKeyFilter added in v0.5.0

func (m *BucketMigrator) WithKeyFilter(keyFilter BucketMigratorKeyFilter) *BucketMigrator

type BucketMigratorDoFunc added in v0.5.0

type BucketMigratorDoFunc func(t db.Transaction, b1, b2 []byte, n utils.Network) error

type BucketMigratorKeyFilter added in v0.5.0

type BucketMigratorKeyFilter func([]byte) (bool, error)

type Migration added in v0.5.0

type Migration interface {
	Before()
	Migrate(db.Transaction, utils.Network) error
}

type MigrationFunc added in v0.5.0

type MigrationFunc func(db.Transaction, utils.Network) error

func (MigrationFunc) Before added in v0.5.0

func (f MigrationFunc) Before()

Before is a no-op.

func (MigrationFunc) Migrate added in v0.5.0

func (f MigrationFunc) Migrate(txn db.Transaction, network utils.Network) error

Migrate returns f(txn).

Jump to

Keyboard shortcuts

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