Documentation ¶
Index ¶
- func DoWithTries(fn func() error, attempts int, delay time.Duration) (err error)
- func NewPGXPoolConnection(poolConn *pgxpool.Conn) *pgxPoolConnection
- type Connection
- type DB
- type DBConfig
- type Database
- func (db *Database) Acquire(ctx context.Context) (Connection, error)
- func (db *Database) Client(ctx context.Context) PGXdb
- func (db *Database) Close()
- func (db Database) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error)
- func (db Database) Exec(ctx context.Context, query string, args ...any) (pgconn.CommandTag, error)
- func (db Database) ExecQueryRow(ctx context.Context, query string, args ...any) pgx.Row
- func (db Database) Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (db Database) Select(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (db *Database) WithinTransaction(ctx context.Context, tFunc func(ctx context.Context) error) (err error)
- type PGXdb
- type TBD
- func (db TBD) Acquire(ctx context.Context) (Connection, error)
- func (db TBD) Client(ctx context.Context) PGXdb
- func (db TBD) Close()
- func (db TBD) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error)
- func (db TBD) Exec(ctx context.Context, query string, args ...any) (pgconn.CommandTag, error)
- func (db TBD) ExecQueryRow(ctx context.Context, query string, args ...any) pgx.Row
- func (db TBD) Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (db TBD) Select(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (db TBD) SetUp(t *testing.T)
- func (db TBD) TearDown()
- func (db TBD) Truncate(ctx context.Context)
- func (db TBD) WithinTransaction(ctx context.Context, tFunc func(ctx context.Context) error) (err error)
- type TestDBConfig
- type Transactor
- type Tx
- func (t Tx) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error)
- func (t Tx) Exec(ctx context.Context, query string, args ...any) (pgconn.CommandTag, error)
- func (t Tx) ExecQueryRow(ctx context.Context, query string, args ...any) pgx.Row
- func (t Tx) Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (t Tx) RegisterType(ctx context.Context, typeName string) error
- func (t Tx) Release()
- func (t Tx) Select(ctx context.Context, dest interface{}, query string, args ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPGXPoolConnection ¶
Types ¶
type Connection ¶
type Connection interface { PGXdb RegisterType(ctx context.Context, typeName string) error Release() }
func ExtractTx ¶
func ExtractTx(ctx context.Context) Connection
ExtractTx extracts transaction from context
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (Database) ExecQueryRow ¶
type PGXdb ¶
type PGXdb interface { Select(ctx context.Context, dest interface{}, query string, args ...interface{}) error Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error Exec(ctx context.Context, query string, args ...interface{}) (pgconn.CommandTag, error) ExecQueryRow(ctx context.Context, query string, args ...interface{}) pgx.Row CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error) }
PGXdb интерфейс для БД
type TBD ¶
type TBD struct {
// contains filtered or unexported fields
}
func NewTestClient ¶
func NewTestClient(ctx context.Context, sc TestDBConfig) (db *TBD, err error)
func (TBD) ExecQueryRow ¶
type TestDBConfig ¶
type Transactor ¶
Click to show internal directories.
Click to hide internal directories.