pg

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(r Rows)

func ClosePool

func ClosePool(p Pool)

func CollectRows

func CollectRows(r Rows) ([]map[string]any, error)

func Commit

func Commit(t Tx) error

func Next

func Next(r Rows) bool

func Rollback

func Rollback(t Tx) error

func RowsAffected

func RowsAffected(r Result) int64

func Scan

func Scan(r Row, dest ...any) error

func ScanBool

func ScanBool(r Row) (bool, error)

func ScanFloat64

func ScanFloat64(r Row) (float64, error)

func ScanInt

func ScanInt(r Row) (int, error)

func ScanInt64

func ScanInt64(r Row) (int64, error)

func ScanRow

func ScanRow(r Rows, dest ...any) error

func ScanString

func ScanString(r Row) (string, error)

Types

type Config

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

func MaxConnIdleTime

func MaxConnIdleTime(cfg Config, d int64) Config

func MaxConnLifetime

func MaxConnLifetime(cfg Config, d int64) Config

func MaxConns

func MaxConns(cfg Config, n int32) Config

func MinConns

func MinConns(cfg Config, n int32) Config

func New

func New(url string) Config

func Retry added in v0.0.6

func Retry(cfg Config, maxAttempts int, delayMs int) Config

type Pool

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

func Connect

func Connect(url string) (Pool, error)

func Open

func Open(cfg Config) (Pool, error)

type Result

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

func Exec

func Exec(p Pool, sql string, args ...any) (Result, error)

func TxExec

func TxExec(t Tx, sql string, args ...any) (Result, error)

type Row

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

func QueryRow

func QueryRow(p Pool, sql string, args ...any) (Row, error)

func TxQueryRow

func TxQueryRow(t Tx, sql string, args ...any) (Row, error)

type Rows

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

func Query

func Query(p Pool, sql string, args ...any) (Rows, error)

func TxQuery

func TxQuery(t Tx, sql string, args ...any) (Rows, error)

type Tx

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

func Begin

func Begin(p Pool) (Tx, error)

Jump to

Keyboard shortcuts

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