modulepackage
0.0.0-20240605072413-bcd33b6ae6ad
Repository: https://github.com/nilorg/sqlxplus.git
Documentation: pkg.go.dev
# README
sqlxplus
golang sqlx wrap logger
Usage
go get github.com/nilorg/sqlxplus
Import
import "github.com/nilorg/sqlxplus"
Example
import (
"github.com/jmoiron/sqlx"
"github.com/nilorg/sqlxplus"
)
func main() {
driverName := "mysql"
dataSourceName := "xxx"
xdb, err := sqlx.Connect(driverName, dataSourceName)
if err != nil {
log.Fatalln(err)
}
xdbpuls := &sqlxplus.DB{SqlxTx: xdb, Log: &StdLogger{}}
var result map[string]interface{}
err = sqlx.GetContext(ctx, xdbpuls.DB(), &result, "select * from user where id = ?", 1)
if err != nil {
log.Fatalln(err)
}
}
# Functions
CheckSqlxTranContextExist 检查sqlx是否存在.
Exec error handling of sqlx.MustExec.
ExecContext error handling of sqlx.MustExecContext.
No description provided by the author
FromSqlxContext 从上下文中获取Sqlx.
No description provided by the author
MapScan 解决sqlx字节数组问题.
NewSqlxContext 创建Sqlx上下文.
NewSqlxTranContext 创建sqlx事务上下文.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
ErrContextNotFoundSqlx 上下文不存在Sqlx错误.
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
StdLogger ...
No description provided by the author
# Interfaces
Logger logger.
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author