pgx3adapter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

Conn is the adapter type for PGx connection connection type

func NewConn

func NewConn(conn *pgx.Conn) *Conn

NewConn instantiates PGx connection adapter

func (*Conn) Exec

func (a *Conn) Exec(ctx context.Context, query string, args ...interface{}) error

Exec runs a query and returns an error if any

func (*Conn) SelectOne

func (a *Conn) SelectOne(ctx context.Context, dst interface{}, query string, args ...interface{}) error

SelectOne runs a select query and scans the object into a struct or returns an error

type ConnPool

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

ConnPool is the adapter type for PGx connection pool connection type

func NewConnPool

func NewConnPool(conn *pgx.ConnPool) *ConnPool

NewConnPool instantiates PGx connection pool adapter

func (*ConnPool) Exec

func (a *ConnPool) Exec(ctx context.Context, query string, args ...interface{}) error

Exec runs a query and returns an error if any

func (*ConnPool) SelectOne

func (a *ConnPool) SelectOne(ctx context.Context, dst interface{}, query string, args ...interface{}) error

SelectOne runs a select query and scans the object into a struct or returns an error

Jump to

Keyboard shortcuts

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