Documentation
¶
Overview ¶
Package cockroachdb provides a CockroachDB driver for Queen migrations.
Index ¶
- func QuoteIdentifier(name string) string
- type Driver
- func (d *Driver) Exec(ctx context.Context, isolationLevel sql.IsolationLevel, fn func(*sql.Tx) error) error
- func (d *Driver) Init(ctx context.Context) error
- func (d *Driver) Lock(ctx context.Context, timeout time.Duration) error
- func (d *Driver) RecordTx(ctx context.Context, tx *sql.Tx, m *queen.Migration, ...) error
- func (d *Driver) RemoveTx(ctx context.Context, tx *sql.Tx, version string) error
- func (d *Driver) Unlock(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QuoteIdentifier ¶
QuoteIdentifier quotes a SQL identifier.
Types ¶
type Driver ¶
Driver implements the queen.Driver interface for CockroachDB.
func NewWithTableName ¶
NewWithTableName creates a new CockroachDB driver with a custom table name.
func (*Driver) Exec ¶
func (d *Driver) Exec(ctx context.Context, isolationLevel sql.IsolationLevel, fn func(*sql.Tx) error) error
Exec executes fn in a transaction and retries CockroachDB serialization failures. Callbacks can run more than once and must therefore be retry-safe.
func (*Driver) Init ¶
Init creates the migrations tracking table and lock table if they don't exist.
func (*Driver) RecordTx ¶
func (d *Driver) RecordTx(ctx context.Context, tx *sql.Tx, m *queen.Migration, meta *queen.MigrationMetadata) error
RecordTx records a migration in the transaction used for its body.
Click to show internal directories.
Click to hide internal directories.