Documentation
¶
Index ¶
- func CloseConnDef(name string) (err error)
- func ConnDefinitions() (condefs []string)
- func ConnStats(name string) (stats map[string]any)
- func Exec(name, query string, a ...any) (resut sql.Result, err error)
- func ExecContext(ctx context.Context, name, query string, a ...any) (result sql.Result, err error)
- func NumberedRecords(rows SqlRows) func(func(Record, int64) bool)
- func Records(rows SqlRows) func(func(Record) bool)
- func Register(name string, driver sqldriver.Driver, dvrparsesql snksqldvr.DriverParseSql) (err error)
- type ConnDefinition
- type FormatQuery
- type FormatQueryFunc
- type Record
- type SQLHandler
- type SqlRows
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseConnDef ¶
func ConnDefinitions ¶
func ConnDefinitions() (condefs []string)
func ExecContext ¶
Types ¶
type ConnDefinition ¶
type ConnDefinition interface {
Query(query string, a ...any) (rows SqlRows, err error)
QueryContext(ctx context.Context, query string, a ...any) (rows SqlRows, err error)
Exec(query string, a ...any) (result sql.Result, err error)
ExecContext(ctx context.Context, query string, a ...any) (result sql.Result, err error)
Close() error
Stats() sql.DBStats
}
func DefineConn ¶
func DefineConn(name, datasource string) (conndef ConnDefinition, err error)
type FormatQuery ¶
type FormatQuery interface {
FprintQuery(out io.Writer, name, driver, query string, a ...any) (err error)
}
var GlobalFormatQuery FormatQuery
type FormatQueryFunc ¶
func (FormatQueryFunc) FprintQuery ¶
type SQLHandler ¶
type SQLHandler interface {
Query(name string, query string, a ...any) (records func(func(Record, int64) bool), err error)
Exec(name string, query string, a ...any) (any, error)
Stats(name string) (stats any)
Conns() []string
DefineConn(name string, datasource string) (conndef ConnDefinition, err error)
}
func InvokeSQLHandler ¶
func InvokeSQLHandler(ctx context.Context, formatQuery FormatQueryFunc, params parameters.Parameters) SQLHandler
Click to show internal directories.
Click to hide internal directories.