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 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(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
Click to show internal directories.
Click to hide internal directories.