Documentation
¶
Index ¶
- func Close(pool Pool) error
- func CloseRows(rows Rows) error
- func Count(pool Pool, query string, args ...any) (int64, error)
- func Exec(pool Pool, query string, args ...any) (int64, error)
- func ExecCtx(h ctxpkg.Handle, pool Pool, query string, args ...any) (int64, error)
- func Exists(pool Pool, query string, args ...any) (bool, error)
- func LastInsertId(pool Pool, query string, args ...any) (int64, error)
- func Ping(pool Pool) error
- func RawDB(pool Pool) *sql.DB
- func ScanAll[T any](rows Rows, sample []T) ([]T, error)
- func ScanOne[T any](rows Rows, sample T) (T, error)
- func ScanRow(row Row, sample any) (any, error)
- func Transaction(pool Pool, fn func(Tx) error) error
- func TransactionWith(pool Pool, opts TxOptions, fn func(Tx) error) error
- func TxExec(tx Tx, query string, args ...any) (int64, error)
- type IsolationLevel
- type Pool
- type Row
- type Rows
- type Tx
- type TxOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LastInsertId ¶ added in v0.5.0
Types ¶
type IsolationLevel ¶ added in v0.5.0
type IsolationLevel string
const ( IsolationLevelDefault IsolationLevel = "" IsolationLevelReadUncommitted IsolationLevel = "read_uncommitted" IsolationLevelReadCommitted IsolationLevel = "read_committed" IsolationLevelRepeatableRead IsolationLevel = "repeatable_read" IsolationLevelSerializable IsolationLevel = "serializable" )
func (IsolationLevel) String ¶ added in v0.5.0
func (e IsolationLevel) String() string
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
type TxOptions ¶
type TxOptions struct {
IsolationLevel IsolationLevel
ReadOnly bool
}
Click to show internal directories.
Click to hide internal directories.