Documentation
¶
Index ¶
- type AfterHook
- type BeforeHook
- type CallerType
- type Conn
- type ConnCloser
- type FullHook
- type HookConn
- func (c *HookConn) Begin(ctx context.Context) (Tx, error)
- func (c *HookConn) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (Tx, error)
- func (c *HookConn) Close(ctx context.Context) error
- func (c *HookConn) Conn() InputConn
- func (c *HookConn) Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error)
- func (c *HookConn) Ping(ctx context.Context) error
- func (c *HookConn) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
- func (c *HookConn) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
- func (c *HookConn) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults
- type HookConnOption
- type HookData
- type HookTx
- func (t *HookTx) Begin(_ context.Context) (Tx, error)
- func (t *HookTx) Commit(ctx context.Context) error
- func (t *HookTx) Conn() *pgx.Conn
- func (t *HookTx) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error)
- func (t *HookTx) Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error)
- func (t *HookTx) LargeObjects() pgx.LargeObjects
- func (t *HookTx) Prepare(ctx context.Context, name, sql string) (*pgconn.StatementDescription, error)
- func (t *HookTx) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
- func (t *HookTx) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
- func (t *HookTx) Rollback(ctx context.Context) error
- func (t *HookTx) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults
- type InputConn
- type PoolCloser
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeforeHook ¶
type CallerType ¶
type CallerType string
const ( CallerExec CallerType = "exec" CallerQuery CallerType = "query" CallerQueryRow CallerType = "query_row" CallerSendBatch CallerType = "send_batch" CallerPing CallerType = "ping" CallerClose CallerType = "close" CallerPrepare CallerType = "prepare" CallerBegin CallerType = "begin" CallerCommit CallerType = "commit" CallerRollback CallerType = "rollback" )
type Conn ¶
type Conn interface {
Begin(ctx context.Context) (Tx, error)
BeginTx(ctx context.Context, txOptions pgx.TxOptions) (Tx, error)
Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error)
Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
SendBatch(ctx context.Context, b *pgx.Batch) (br pgx.BatchResults)
Ping(ctx context.Context) error
Close(ctx context.Context) error
Conn() InputConn
}
type ConnCloser ¶
type FullHook ¶
type FullHook interface {
BeforeHook
AfterHook
}
type HookConn ¶
type HookConn struct {
// contains filtered or unexported fields
}
func NewHookConn ¶
func NewHookConn(conn InputConn, opts ...HookConnOption) *HookConn
type HookConnOption ¶
type HookConnOption interface {
// contains filtered or unexported methods
}
func WithAfterHooks ¶
func WithAfterHooks(hooks ...AfterHook) HookConnOption
func WithBeforeHooks ¶
func WithBeforeHooks(hooks ...BeforeHook) HookConnOption
func WithHooks ¶
func WithHooks(hooks ...FullHook) HookConnOption
type HookTx ¶
type HookTx struct {
// contains filtered or unexported fields
}
func (*HookTx) CopyFrom ¶
func (t *HookTx) CopyFrom( ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource, ) (int64, error)
func (*HookTx) LargeObjects ¶
func (t *HookTx) LargeObjects() pgx.LargeObjects
type InputConn ¶
type InputConn interface {
Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error)
Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
SendBatch(ctx context.Context, b *pgx.Batch) (br pgx.BatchResults)
Begin(ctx context.Context) (Tx, error)
BeginTx(ctx context.Context, txOptions pgx.TxOptions) (Tx, error)
Ping(ctx context.Context) error
}
type PoolCloser ¶
type PoolCloser interface {
Close()
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.