pgxconn

package
v0.0.0-...-6ee8545 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PgxBatch

type PgxBatch interface {
	Queue(query string, arguments ...any) *pgx.QueuedQuery
	Len() int
}

type PgxConn

type PgxConn interface {
	Close()
	Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
	Query(ctx context.Context, sql string, args ...interface{}) (PgxRows, error)
	QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
	CopyFrom(
		ctx context.Context,
		tx pgx.Tx,
		tableName pgx.Identifier,
		columnNames []string,
		rowSrc pgx.CopyFromSource,
		oids []uint32,
	) (int64, error)
	CopyFromRows(rows [][]interface{}) pgx.CopyFromSource
	NewBatch() PgxBatch
	SendBatch(ctx context.Context, b PgxBatch) (pgx.BatchResults, error)
	Acquire(ctx context.Context) (*pgxpool.Conn, error)
	BeginTx(ctx context.Context) (pgx.Tx, error)
}

func NewPgxConn

func NewPgxConn(pool *pgxpool.Pool) PgxConn

func NewQueryLoggingPgxConn

func NewQueryLoggingPgxConn(pool *pgxpool.Pool) PgxConn

This is only used by querier to log the time consumed by SQL queries executed using Query(), QueryRow()

type PgxRows

type PgxRows interface {
	Next() bool
	Scan(...interface{}) error
	Err() error
	Close()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL