Documentation ¶
Index ¶
- Variables
- type AlembicPostgresDriver
- func (apd *AlembicPostgresDriver) Close(ctx context.Context) error
- func (apd *AlembicPostgresDriver) Conn() *pgx.Conn
- func (apd *AlembicPostgresDriver) RunTx(ctx context.Context, f migrate.TxMigrationFunc[pgx.Tx]) error
- func (apd *AlembicPostgresDriver) Version(ctx context.Context) (string, error)
- func (apd *AlembicPostgresDriver) WriteVersion(ctx context.Context, tx pgx.Tx, version, replaced string) error
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 (apd *AlembicPostgresDriver) RunTx(ctx context.Context, f migrate.TxMigrationFunc[pgx.Tx]) error
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
Source Files ¶
- driver.go
- manager.go
- zz_migration.0001_1eaeba4b8a73_initial.go
- zz_migration.0002_add_reverse_index.go
- zz_migration.0003_add_unique_living_ns.go
- zz_migration.0004_add_transaction_timestamp_index.go
- zz_migration.0005_change_transaction_timestamp_default.go
- zz_migration.0006_add_gc_index.go
- zz_migration.0007_add_unique_datastore_id.go
- zz_migration.0008_add_ns_config_id.go
- zz_migration.0009_caveat.go
- zz_migration.0010_add_xid8_columns.go
- zz_migration.0011_backfill_xid_add_indices.go
- zz_migration.0012_add_xid_constraints.go
- zz_migration.0013_drop_id_constraints.go
- zz_migration.0014_drop_bigserial_ids.go
- zz_migration.0015_add_gc_covering_index.go
Click to show internal directories.
Click to hide internal directories.