db

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(pool Pool) error

func CloseRows

func CloseRows(rows Rows) error

func Count

func Count(pool Pool, query string, args ...any) (int64, error)

func Exec

func Exec(pool Pool, query string, args ...any) (int64, error)

func Exists

func Exists(pool Pool, query string, args ...any) (bool, error)

func Ping

func Ping(pool Pool) error

func ScanAll

func ScanAll(rows Rows, sample any) (any, error)

func ScanOne

func ScanOne(rows Rows, sample any) (any, error)

func ScanRow

func ScanRow(row Row, sample any) (any, error)

func Transaction

func Transaction(pool Pool, fn func(Tx) error) error

func TransactionWith

func TransactionWith(pool Pool, opts TxOptions, fn func(Tx) error) error

func TxExec

func TxExec(tx Tx, query string, args ...any) (int64, error)

Types

type Pool

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

func Open

func Open(driver string, connString string) (Pool, error)

type Row

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

func QueryRow

func QueryRow(pool Pool, query string, args ...any) Row

func TxQueryRow

func TxQueryRow(tx Tx, query string, args ...any) Row

type Rows

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

func Query

func Query(pool Pool, query string, args ...any) (Rows, error)

func TxQuery

func TxQuery(tx Tx, query string, args ...any) (Rows, error)

type Tx

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

type TxOptions

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

Jump to

Keyboard shortcuts

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