Documentation
¶
Overview ¶
Package postgres provides a PostgreSQL driver for Queen migrations.
Index ¶
- type Driver
- 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 ¶
This section is empty.
Types ¶
type Driver ¶
Driver implements the queen.Driver interface for PostgreSQL.
func NewFromPool ¶
NewFromPool creates a PostgreSQL driver from a native pgx pool.
The returned driver uses database/sql through pgx's stdlib adapter. Closing the driver closes only the adapter handle; it does not close the pgx pool.
func NewFromPoolWithTableName ¶
NewFromPoolWithTableName creates a PostgreSQL driver from a native pgx pool with a custom migration table name.
func NewWithTableName ¶
NewWithTableName creates a new PostgreSQL driver with a custom table name.
func (*Driver) RecordTx ¶
func (d *Driver) RecordTx(ctx context.Context, tx *sql.Tx, m *queen.Migration, meta *queen.MigrationMetadata) error
RecordTx records an applied migration in the migration transaction.
Click to show internal directories.
Click to hide internal directories.