Documentation ¶
Index ¶
- func ScanAll[TData any](rows *sqlx.Rows, mode StructScanMode, sec StructScanSafety, close bool) ([]TData, error)
- func ScanSingle[TData any](rows *sqlx.Rows, mode StructScanMode, sec StructScanSafety, close bool) (TData, error)
- type DB
- type Listener
- type PP
- type Queryable
- type StructScanMode
- type StructScanSafety
- type StructScanner
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ScanAll ¶ added in v0.0.34
func ScanAll[TData any](rows *sqlx.Rows, mode StructScanMode, sec StructScanSafety, close bool) ([]TData, error)
func ScanSingle ¶ added in v0.0.34
func ScanSingle[TData any](rows *sqlx.Rows, mode StructScanMode, sec StructScanSafety, close bool) (TData, error)
Types ¶
type DB ¶
type DB interface { Exec(ctx context.Context, sql string, prep PP) (sql.Result, error) Query(ctx context.Context, sql string, prep PP) (*sqlx.Rows, error) Ping(ctx context.Context) error BeginTransaction(ctx context.Context, iso sql.IsolationLevel) (Tx, error) AddListener(listener Listener) Exit() error }
type Listener ¶
type Listener interface { PrePing(ctx context.Context) error PreTxBegin(ctx context.Context, txid uint16) error PreTxCommit(txid uint16) error PreTxRollback(txid uint16) error PreQuery(ctx context.Context, txID *uint16, sql *string, params *PP) error PreExec(ctx context.Context, txID *uint16, sql *string, params *PP) error PostPing(result error) PostTxBegin(txid uint16, result error) PostTxCommit(txid uint16, result error) PostTxRollback(txid uint16, result error) PostQuery(txID *uint16, sqlOriginal string, sqlReal string, params PP) PostExec(txID *uint16, sqlOriginal string, sqlReal string, params PP) }
type StructScanMode ¶ added in v0.0.44
type StructScanMode string
const ( SModeFast StructScanMode = "FAST" SModeExtended StructScanMode = "EXTENDED" )
type StructScanSafety ¶ added in v0.0.44
type StructScanSafety string
const ( Safe StructScanSafety = "SAFE" Unsafe StructScanSafety = "UNSAFE" )
type StructScanner ¶ added in v0.0.44
func NewStructScanner ¶ added in v0.0.44
func NewStructScanner(rows *sqlx.Rows, unsafe bool) *StructScanner
func (*StructScanner) Start ¶ added in v0.0.44
func (r *StructScanner) Start(dest any) error
func (*StructScanner) StructScanBase ¶ added in v0.0.44
func (r *StructScanner) StructScanBase(dest any) error
StructScanBase forked from github.com/jmoiron/sqlx@v1.3.5/sqlx.go without (relevant) changes
func (*StructScanner) StructScanExt ¶ added in v0.0.44
func (r *StructScanner) StructScanExt(dest any) error
StructScanExt forked from github.com/jmoiron/sqlx@v1.3.5/sqlx.go does also wok with nullabel structs (from LEFT JOIN's)
Click to show internal directories.
Click to hide internal directories.