Documentation
¶
Index ¶
- Variables
- func ArrayPostgreSQL(array any) interface{ ... }
- func Discard() any
- func Open(dsn string) (*sql.DB, error)
- type BeginTx
- type Conn
- type ExecContext
- type MismatchColumnsError
- type PingContext
- type PrepareContext
- type QueryContext
- type QueryRowContext
- type RoundRobinError
- type TxConn
- type WrapExec
- type WrapQuery
- type WrapQueryRow
- type WrapTransaction
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidCommand = sdk.Errorf("brock/sdksql: invalid command") ErrMultipleCommands = sdk.Errorf("brock/sdksql: multiple commands") )
View Source
var ( ErrInvalidArguments = sdk.Errorf("brock/sdksql: invalid arguments for scan") ErrInvalidTransaction = sdk.Errorf("brock/sdksql: invalid transaction") ErrNoColumns = sdk.Errorf("brock/sdksql: no columns returned") )
View Source
var Tool tool
View Source
var Wrap wrap
Functions ¶
Types ¶
type Conn ¶
type Conn interface {
BeginTx
io.Closer
PingContext
TxConn
}
Conn is a common interface of *sql.DB and *sql.Conn.
func RoundRobin ¶
type ExecContext ¶
type MismatchColumnsError ¶
type MismatchColumnsError struct{ Col, Dst int }
func (*MismatchColumnsError) Error ¶
func (err *MismatchColumnsError) Error() string
type PingContext ¶
type PrepareContext ¶
type QueryContext ¶
type QueryRowContext ¶
type RoundRobinError ¶
type RoundRobinError struct{ Total, Index int }
RoundRobinError reporting issue when getting from set of Conn from RoundRobin.
func (*RoundRobinError) Error ¶
func (err *RoundRobinError) Error() string
type TxConn ¶
type TxConn interface {
ExecContext
PrepareContext
QueryContext
QueryRowContext
}
TxConn is a common interface of *sql.DB, *sql.Conn, and *sql.Tx.
type WrapQuery ¶
type WrapQuery interface {
// Scan accept do, a func that accept `i int` as index and returning list
// of pointers.
// pointers == nil // break the loop
// len(pointers) < 1 // skip the current loop
// len(pointers) > 0 // assign the pointer, MUST be same as the length of columns
Scan(row func(i int) (pointers []any)) error
}
type WrapQueryRow ¶
type WrapTransaction ¶
Click to show internal directories.
Click to hide internal directories.