migrations

package
v1.35.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

SpannerMigrations implements a migration manager for the Spanner datastore.

Functions

This section is empty.

Types

type SpannerMigrationDriver

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

SpannerMigrationDriver can migrate a Cloud Spanner instance The adminClient is required for DDL changes

func NewSpannerDriver

func NewSpannerDriver(ctx context.Context, database, credentialsFilePath, emulatorHost string) (*SpannerMigrationDriver, error)

NewSpannerDriver returns a migration driver for the given Cloud Spanner instance

func (*SpannerMigrationDriver) Close

func (*SpannerMigrationDriver) Conn added in v1.9.0

func (smd *SpannerMigrationDriver) Conn() Wrapper

Conn returns the underlying spanner clients in a Wrapper instance for MigrationFunc to use

func (*SpannerMigrationDriver) RunTx added in v1.9.0

func (*SpannerMigrationDriver) Version

func (smd *SpannerMigrationDriver) Version(ctx context.Context) (string, error)

func (*SpannerMigrationDriver) WriteVersion

func (smd *SpannerMigrationDriver) WriteVersion(_ context.Context, rwt *spanner.ReadWriteTransaction, version, replaced string) error

type VersionProvider added in v1.27.0

type VersionProvider interface {
	Version(ctx context.Context) (string, error)
}

VersionProvider returns the migration version a specific spanner datastore is running at

func NewSpannerVersionChecker added in v1.27.0

func NewSpannerVersionChecker(c *spanner.Client) VersionProvider

NewSpannerVersionChecker returns a VersionProvider for the argument spanner.Client

type Wrapper added in v1.9.0

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

Wrapper makes it possible to forward the spanner clients to the MigrationFunc's to execute

Jump to

Keyboard shortcuts

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