pgxpool

package
v0.0.0-...-b00f800 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConfig

func ParseConfig(connString string) (*pgxpool.Config, error)

Types

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func Connect

func Connect(sensor *instana.Sensor, ctx context.Context, connString string) (*Pool, error)

func ConnectConfig

func ConnectConfig(sensor *instana.Sensor, ctx context.Context, config *pgxpool.Config) (*Pool, error)

func (*Pool) Begin

func (p *Pool) Begin(ctx context.Context) (Tx, error)

func (*Pool) Close

func (p *Pool) Close()

func (*Pool) Exec

func (p *Pool) Exec(ctx context.Context, sql string, args ...interface{}) (pgconn.CommandTag, error)

func (*Pool) PgxPool

func (p *Pool) PgxPool() *pgxpool.Pool

func (*Pool) Query

func (p *Pool) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)

func (*Pool) QueryRow

func (p *Pool) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row

type Tx

type Tx interface {
	Commit(ctx context.Context) error
	Rollback(ctx context.Context) error
	Exec(ctx context.Context, sql string, arguments ...interface{}) (commandTag pgconn.CommandTag, err error)
	Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
	Conn() *pgx.Conn
}

Jump to

Keyboard shortcuts

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