pgxwrapper

package
v0.0.0-...-8b4ae58 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PgxWrapper

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

PgxWrapper is a wrapper to jackc/pgx/v4.

func New

func New(
	ctx context.Context,
	dsn string,
	waitFor time.Duration,
	tracer opentracing.Tracer,
) (PgxWrapper, error)

New returns a new PgxWrapper given a postgresql dsn. The wrapper has built in tracing. The connection will be retried until completion.

func (PgxWrapper) Exec

func (p PgxWrapper) Exec(ctx context.Context, queryName, sql string, args ...interface{}) error

Exec is pgx's concrete implementation for executing a query with tracing.

func (PgxWrapper) GetConn

func (p PgxWrapper) GetConn(ctx context.Context) (*pgx.Conn, error)

GetConn returns the underlying pgx connection.

Jump to

Keyboard shortcuts

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