Documentation ¶
Index ¶
- Variables
- func MigrateIfNeeded(ctx context.Context, targetDB db.DB, network *utils.Network, ...) error
- func SchemaMetadata(targetDB db.DB) (schemaMetadata, error)
- type BucketMigrator
- func (m *BucketMigrator) Before(_ []byte) error
- func (m *BucketMigrator) Migrate(ctx context.Context, txn db.Transaction, network *utils.Network, ...) ([]byte, error)
- func (m *BucketMigrator) WithBatchSize(batchSize uint) *BucketMigrator
- func (m *BucketMigrator) WithBefore(before func()) *BucketMigrator
- func (m *BucketMigrator) WithKeyFilter(keyFilter BucketMigratorKeyFilter) *BucketMigrator
- type BucketMigratorDoFunc
- type BucketMigratorKeyFilter
- type Migration
- type MigrationFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCallWithNewTransaction = errors.New("call with new transaction")
Functions ¶
func MigrateIfNeeded ¶
func SchemaMetadata ¶ added in v0.8.0
SchemaMetadata retrieves metadata about a database schema from the given database.
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(_ []byte) error
func (*BucketMigrator) Migrate ¶ added in v0.5.0
func (m *BucketMigrator) Migrate(ctx context.Context, txn db.Transaction, network *utils.Network, log utils.SimpleLogger) ([]byte, 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 BucketMigratorKeyFilter ¶ added in v0.5.0
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(_ []byte) error
Before is a no-op.
func (MigrationFunc) Migrate ¶ added in v0.5.0
func (f MigrationFunc) Migrate(_ context.Context, txn db.Transaction, network *utils.Network, _ utils.SimpleLogger) ([]byte, error)
Migrate returns f(txn).
Click to show internal directories.
Click to hide internal directories.