Documentation ¶
Index ¶
- Variables
- func ApplyMigrations(ctx context.Context, logger logx.Logger, conn *DB, tableName string, ...) error
- func Commit(logger logx.Logger, tx *Tx, err error) error
- func RetrieveAppliedMigrations(ctx context.Context, logger logx.Logger, conn *DB, tableName string) (map[int]AppliedMigration, error)
- func RollbackMigrations(ctx context.Context, logger logx.Logger, conn *DB, tableName string, ...) error
- func VerifyAppliedMigrations(ctx context.Context, logger logx.Logger, conn *DB, tableName string, ...) error
- type AppliedMigration
- type DB
- func (db *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (db *DB) Close() error
- func (db *DB) Exec(query string, args ...interface{}) (sql.Result, error)
- func (db *DB) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (db *DB) Ping() error
- func (db *DB) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (db *DB) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (db *DB) QueryRow(query string, args ...interface{}) squirrel.RowScanner
- func (db *DB) QueryRowContext(ctx context.Context, query string, args ...interface{}) squirrel.RowScanner
- type DBDriver
- type DBOption
- func DBConnectionMaxLifetime(max time.Duration) DBOption
- func DBDatabaseName(dbName string) DBOption
- func DBHost(host string) DBOption
- func DBPassword(password string) DBOption
- func DBPort(port int) DBOption
- func DBRootCAPool(rootCAPool *x509.CertPool) DBOption
- func DBUsername(username string) DBOption
- type Migration
- type MigrationFunc
- type Tx
- func (tx *Tx) Commit() error
- func (tx *Tx) Exec(query string, args ...interface{}) (sql.Result, error)
- func (tx *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (tx *Tx) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (tx *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (tx *Tx) QueryRow(query string, args ...interface{}) squirrel.RowScanner
- func (tx *Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) squirrel.RowScanner
- func (tx *Tx) Rollback() error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ApplyMigrations ¶
func RollbackMigrations ¶
Types ¶
type AppliedMigration ¶
type DB ¶
func (*DB) BeginTx ¶
BeginTx will generate a Database-aware transaction, with all database information duplicated from the Database-aware connection
func (*DB) ExecContext ¶
func (*DB) QueryContext ¶
func (*DB) QueryRowContext ¶
type DBOption ¶
type DBOption interface {
// contains filtered or unexported methods
}
func DBConnectionMaxLifetime ¶
func DBDatabaseName ¶
func DBPassword ¶
func DBRootCAPool ¶
func DBUsername ¶
type Migration ¶
type Migration struct { Name string Up MigrationFunc Down MigrationFunc }
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) ExecContext ¶
func (*Tx) QueryContext ¶
func (*Tx) QueryRowContext ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.