migrations

package
v1.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DatabaseMigrations = migrate.NewManager[*AlembicPostgresDriver, *pgx.Conn, pgx.Tx]()

DatabaseMigrations implements a migration manager for the Postgres Driver.

Functions

This section is empty.

Types

type AlembicPostgresDriver

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

AlembicPostgresDriver implements a schema migration facility for use in SpiceDB's Postgres datastore.

It is compatible with the popular Python library, Alembic

func NewAlembicPostgresDriver

func NewAlembicPostgresDriver(url string) (*AlembicPostgresDriver, error)

NewAlembicPostgresDriver creates a new driver with active connections to the database specified.

func (*AlembicPostgresDriver) Close added in v1.5.0

func (apd *AlembicPostgresDriver) Close(ctx context.Context) error

Close disposes the driver.

func (*AlembicPostgresDriver) Conn added in v1.9.0

func (apd *AlembicPostgresDriver) Conn() *pgx.Conn

Conn returns the underlying pgx.Conn instance for this driver

func (*AlembicPostgresDriver) RunTx added in v1.9.0

func (*AlembicPostgresDriver) Version

func (apd *AlembicPostgresDriver) Version(ctx context.Context) (string, error)

Version returns the version of the schema to which the connected database has been migrated.

func (*AlembicPostgresDriver) WriteVersion

func (apd *AlembicPostgresDriver) WriteVersion(ctx context.Context, tx pgx.Tx, version, replaced string) error

Jump to

Keyboard shortcuts

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