pg

package
v0.0.0-...-aaa61ac Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, pgCfg *pgxpool.Config) (*client, error)

Types

type Client

type Client interface {
	Close() error
	PG() PG
}

type Closer

type Closer interface {
	Close()
}

type NamedScanner

type NamedScanner interface {
	ScanOne(ctx context.Context, dest interface{}, q Query, args ...interface{}) error
	ScanAll(ctx context.Context, dest interface{}, q Query, args ...interface{}) error
}

type PG

type PG interface {
	QueryExecer
	NamedScanner
	Pinger
	Closer
}

type Pinger

type Pinger interface {
	Ping(ctx context.Context) error
}

type Query

type Query struct {
	Name     string
	QueryRaw string
}

type QueryExecer

type QueryExecer interface {
	Exec(ctx context.Context, q Query, args ...interface{}) (pgconn.CommandTag, error)
	Query(ctx context.Context, q Query, args ...interface{}) (pgx.Rows, error)
	QueryRow(ctx context.Context, q Query, args ...interface{}) pgx.Row
}

Jump to

Keyboard shortcuts

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