Documentation ¶
Index ¶
- Constants
- func DefaultPoolOpener(ctx context.Context, dsn string) (*pgxpool.Pool, error)
- func Query[T any](ctx context.Context, db *DB, query string, pointers func(*T) []interface{}, ...) ([]T, error)
- type DB
- func (db *DB) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error)
- func (db *DB) DoTx(f func(db dbx.DBxer[*pgxpool.Pool, pgx.Tx, pgx.TxOptions]) error, ...) error
- func (db *DB) DoTxContext(ctx context.Context, ...) error
- func (db *DB) Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error)
- func (db *DB) Prepare(ctx context.Context, name, sql string) (*pgconn.StatementDescription, error)
- func (db *DB) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
- func (db *DB) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
- func (db *DB) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults
- func (db *DB) Tx() (pgx.Tx, error)
- func (db *DB) WithDefaultNode(criteria cluster.NodeStateCriteria) *DB
- func (db *DB) WithReadFromNode(criteria cluster.NodeStateCriteria) *DB
- func (db *DB) WithWriteToNode(criteria cluster.NodeStateCriteria) *DB
- type Option
- type PoolOpener
Constants ¶
View Source
const DefaultPingTimeout = 15 * time.Second
Variables ¶
This section is empty.
Functions ¶
func DefaultPoolOpener ¶
Types ¶
type DB ¶
func (*DB) DoTxContext ¶
func (*DB) WithDefaultNode ¶
func (db *DB) WithDefaultNode(criteria cluster.NodeStateCriteria) *DB
func (*DB) WithReadFromNode ¶
func (db *DB) WithReadFromNode(criteria cluster.NodeStateCriteria) *DB
func (*DB) WithWriteToNode ¶
func (db *DB) WithWriteToNode(criteria cluster.NodeStateCriteria) *DB
type Option ¶
type Option func(*DB)
func WithInitPingTimeout ¶
func WithPoolOpener ¶
func WithPoolOpener(poolOpener PoolOpener) Option
Click to show internal directories.
Click to hide internal directories.