Documentation
¶
Index ¶
- type Conn
- func (c Conn) Begin(ctx context.Context) (Tx, error)
- func (c Conn) BeginTx(ctx context.Context, opts pgx.TxOptions) (Tx, error)
- func (c Conn) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (c Conn) QueryContext(ctx context.Context, query string, args ...any) (scan.Rows, error)
- type Pool
- func (p Pool) Acquire(ctx context.Context) (PoolConn, error)
- func (p *Pool) AcquireFunc(ctx context.Context, f func(PoolConn) error) error
- func (p Pool) Begin(ctx context.Context) (Tx, error)
- func (p Pool) BeginTx(ctx context.Context, opts pgx.TxOptions) (Tx, error)
- func (p Pool) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (p Pool) QueryContext(ctx context.Context, query string, args ...any) (scan.Rows, error)
- type PoolConn
- func (c PoolConn) Begin(ctx context.Context) (Tx, error)
- func (c PoolConn) BeginTx(ctx context.Context, opts pgx.TxOptions) (Tx, error)
- func (c PoolConn) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (c PoolConn) QueryContext(ctx context.Context, query string, args ...any) (scan.Rows, error)
- type Tx
- func (t Tx) Begin(ctx context.Context) (pgx.Tx, error)
- func (t Tx) Commit(ctx context.Context) error
- func (t Tx) Conn() *pgx.Conn
- func (t Tx) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error)
- func (t Tx) Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error)
- func (t Tx) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (t Tx) LargeObjects() pgx.LargeObjects
- func (t Tx) Prepare(ctx context.Context, name, sql string) (*pgconn.StatementDescription, error)
- func (t Tx) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
- func (t Tx) QueryContext(ctx context.Context, query string, args ...any) (scan.Rows, error)
- func (t Tx) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
- func (t Tx) Rollback(ctx context.Context) error
- func (t Tx) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn is similar to *pgx.Conn but implements [Queryer]
func NewConn ¶
NewConn wraps an *pgx.Conn and returns a type that implements [Queryer] This is useful when an existing *pgx.Conn is used in other places in the codebase
func (Conn) Begin ¶
Begin is similar to *pgxpool.Pool.Begin, but return a transaction that implements [Queryer]
func (Conn) BeginTx ¶
BeginTx is similar to *pgxpool.Pool.BeginTx, but return a transaction that implements [Queryer]
func (Conn) ExecContext ¶
ExecContext executes a query without returning any rows. The args are for any placeholder parameters in the query.
type Pool ¶
Pool is similar to *pgxpool.Pool but implement [Queryer]
func New ¶
New works just like pgxpool.New, but converts the returned *pgxpool.Pool to Pool
func NewPool ¶
NewPool wraps an *pgxpool.Pool and returns a type that implements [bob.Executor] but still retains the expected methods used by *pgxpool.Pool This is useful when an existing *pgxpool.Pool is used in other places in the codebase
func NewWithConfig ¶
NewWithConfig works just like pgxpool.NewWithConfig, but converts the returned *pgxpool.Pool to Pool
func (Pool) Acquire ¶
Acquire is similar to *pgxpool.Pool.Acquire but returns a connection that implement [Queryer]
func (*Pool) AcquireFunc ¶
AcquireFunc is similar to *pgxpool.Pool.AcquireFunc but uses a function that accepts a connection that implements [Queryer].
func (Pool) Begin ¶
Begin is similar to *pgxpool.Pool.Begin, but return a transaction that implements [Queryer]
func (Pool) BeginTx ¶
BeginTx is similar to *pgxpool.Pool.BeginTx, but return a transaction that implements [Queryer]
func (Pool) ExecContext ¶
ExecContext executes a query without returning any rows. The args are for any placeholder parameters in the query.
type PoolConn ¶
Conn is similar to *pgx.Conn but implements [Queryer]
func NewPoolConn ¶
NewConn wraps an *pgx.Conn and returns a type that implements [Queryer] This is useful when an existing *pgx.Conn is used in other places in the codebase
func (PoolConn) Begin ¶
Begin is similar to *pgxpool.Pool.Begin, but return a transaction that implements [Queryer]
func (PoolConn) BeginTx ¶
BeginTx is similar to *pgxpool.Pool.BeginTx, but return a transaction that implements [Queryer]
func (PoolConn) ExecContext ¶
ExecContext executes a query without returning any rows. The args are for any placeholder parameters in the query.
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx is similar to *pgx.Tx but implements [Queryer]
func NewTx ¶
func NewTx(tx pgx.Tx, cancel context.CancelFunc) Tx
NewTx wraps an pgx.Tx and returns a type that implements [Queryer] but still retains the expected methods used by pgx.Tx This is useful when an existing pgx.Tx is used in other places in the codebase the cancel function is optional, but if provided, it will be called when Commit or Rollback is called
func (Tx) CopyFrom ¶
func (t Tx) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
CopyFrom implements pgx.Tx.
func (Tx) ExecContext ¶
ExecContext executes a query without returning any rows. The args are for any placeholder parameters in the query.
func (Tx) LargeObjects ¶
func (t Tx) LargeObjects() pgx.LargeObjects
LargeObjects implements pgx.Tx.
func (Tx) QueryContext ¶
QueryContext executes a query that returns rows, typically a SELECT. The args are for any placeholder parameters in the query.