Documentation
¶
Index ¶
Constants ¶
View Source
const ( OpExec = 1 OpQuery = 2 )
Variables ¶
View Source
var ErrBreak = errors.New("sql scan rows break")
ErrBreak 如果 NextFunc 函数返回 ErrBreak 则提前结束 scan 循环
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error) // 执行语句
Query(ctx context.Context, next NextFunc, query string, args ...interface{}) error // 查询语句
Prepare(ctx context.Context, query string) (*sql.Stmt, error) // 预绑定
BeginTx(ctx context.Context) error // 开启事务
FinishTx(err error) error // 结束事务
}
Client 底层查询代理
Click to show internal directories.
Click to hide internal directories.