Documentation ¶
Index ¶
- Variables
- type CRDBDriver
- func (apd *CRDBDriver) Close(ctx context.Context) error
- func (apd *CRDBDriver) Conn() *pgx.Conn
- func (apd *CRDBDriver) RunTx(ctx context.Context, f migrate.TxMigrationFunc[pgx.Tx]) error
- func (apd *CRDBDriver) Version(ctx context.Context) (string, error)
- func (apd *CRDBDriver) WriteVersion(ctx context.Context, tx pgx.Tx, version, replaced string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var CRDBMigrations = migrate.NewManager[*CRDBDriver, *pgx.Conn, pgx.Tx]()
CRDBMigrations implements a migration manager for the CRDBDriver.
Functions ¶
This section is empty.
Types ¶
type CRDBDriver ¶
type CRDBDriver struct {
// contains filtered or unexported fields
}
CRDBDriver implements a schema migration facility for use in SpiceDB's CRDB datastore.
func NewCRDBDriver ¶
func NewCRDBDriver(url string) (*CRDBDriver, error)
NewCRDBDriver creates a new driver with active connections to the database specified.
func (*CRDBDriver) Close ¶ added in v1.5.0
func (apd *CRDBDriver) Close(ctx context.Context) error
Close disposes the driver.
func (*CRDBDriver) Conn ¶ added in v1.9.0
func (apd *CRDBDriver) Conn() *pgx.Conn
Conn returns the underlying pgx.Conn instance for this driver
func (*CRDBDriver) RunTx ¶ added in v1.9.0
func (apd *CRDBDriver) RunTx(ctx context.Context, f migrate.TxMigrationFunc[pgx.Tx]) error
func (*CRDBDriver) Version ¶
func (apd *CRDBDriver) Version(ctx context.Context) (string, error)
Version returns the version of the schema to which the connected database has been migrated.
func (*CRDBDriver) WriteVersion ¶
func (apd *CRDBDriver) WriteVersion(ctx context.Context, tx pgx.Tx, version, replaced string) error
Source Files ¶
- driver.go
- manager.go
- zz_migration.0001_initial_schema.go
- zz_migration.0002_add_transactions.go
- zz_migration.0003_add_metadata_and_counters.go
- zz_migration.0004_add_caveats.go
- zz_migration.0005_remove_stats_table.go
- zz_migration.0006_add_relationship_counters_table.go
- zz_migration.0007_add_integrity_relationtuple_table.go
Click to show internal directories.
Click to hide internal directories.