postgres

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicateEntry = errors.New("postgres: duplicate entry")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Execer
	Close() error
}

func NewClient

func NewClient(
	ctx context.Context,
	dbUser, dbPass, dbHost string,
	dbPort int,
	dbName string,
	opts ...Option,
) (Client, error)

type Execer

type Execer interface {
	ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
}

type JSONObject

type JSONObject struct {
	Val interface{}
}

func (*JSONObject) Scan

func (o *JSONObject) Scan(src interface{}) error

func (JSONObject) Value

func (o JSONObject) Value() (driver.Value, error)

type Option

type Option func(*options)

func WithConnMaxLifetime

func WithConnMaxLifetime(cml time.Duration) Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithMaxIdleConns

func WithMaxIdleConns(mic int) Option

func WithMaxOpenConns

func WithMaxOpenConns(moc int) Option

type Result

type Result interface {
	LastInsertId() (int64, error)
	RowsAffected() (int64, error)
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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