Documentation ¶
Index ¶
- Variables
- type SpannerMigrationDriver
- func (smd *SpannerMigrationDriver) Close(_ context.Context) error
- func (smd *SpannerMigrationDriver) Conn() Wrapper
- func (smd *SpannerMigrationDriver) RunTx(ctx context.Context, f migrate.TxMigrationFunc[*spanner.ReadWriteTransaction]) error
- func (smd *SpannerMigrationDriver) Version(ctx context.Context) (string, error)
- func (smd *SpannerMigrationDriver) WriteVersion(_ context.Context, rwt *spanner.ReadWriteTransaction, version, replaced string) error
- type VersionProvider
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
View Source
var SpannerMigrations = migrate.NewManager[*SpannerMigrationDriver, Wrapper, *spanner.ReadWriteTransaction]()
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 (smd *SpannerMigrationDriver) Close(_ context.Context) error
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 (smd *SpannerMigrationDriver) RunTx(ctx context.Context, f migrate.TxMigrationFunc[*spanner.ReadWriteTransaction]) error
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
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
Source Files ¶
- driver.go
- manager.go
- zz_migration.0001_initial_schema.go
- zz_migration.0002_add_metadata_and_counters.go
- zz_migration.0003_add_caveats.go
- zz_migration.0004_register_change_stream.go
- zz_migration.0005_drop_changelog_table.go
- zz_migration.0006_register_schema_change_stream.go
- zz_migration.0007_register_combined_change_stream.go
- zz_migration.0008_delete_older_changestreams.go
- zz_migration.0009_add_relationship_counters_table.go
Click to show internal directories.
Click to hide internal directories.