Categorygithub.com/gnodux/sqlxx
modulepackage
1.3.4
Repository: https://github.com/gnodux/sqlxx.git
Documentation: pkg.go.dev

# README

sqlx template & database factory extension

Features

  • sql template
  • database factory

更新版本

GOPROXY=https://goproxy.cn go list -m github.com/gnodux/sqlxx
GOPROXY=https://proxy.golang.org go list -m github.com/gnodux/sqlxx

usage

# Packages

No description provided by the author
No description provided by the author
Package expr package 用于生成sql语句.
No description provided by the author
No description provided by the author

# Functions

Boost 对mapper的Field进行wrap处理、绑定数据源、绑定sql模版、绑定事务级别、绑定是否只读等 dest: mapper对象 ds: 数据源.
BoostMapper 对mapper的Field进行wrap处理、绑定数据源、绑定sql模版、绑定事务级别、绑定是否只读等 change: 2023-7-12 修改绑定策略,从延迟绑定修改到boost时绑定,动态打开数据库的需求不高,且模版延迟绑定和获取数据库需要使用到锁,对性能有一定影响.
No description provided by the author
No description provided by the author
EvalBeforeHook eval before hook 如果entity是nil,那么不会调用任何hook 如果entity是struct 而非指针,那么在调用EvalBeforeHook之前,需要先将entity转换为指针.
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
NewExecFuncWith 创建一个 ExecFunc db:*DB 数据库 tpl: SQL模版或者inline SQL.
No description provided by the author
No description provided by the author
NewMapper 创建一个mapper dataSource: 数据源.
NewMapperWith 创建一个mapper factory: 数据库管理器 dataSource: 数据源.
NewNamedExecFuncWith 创建一个 NamedExecFunc db:*DB 数据库管理器 tpl: SQL模版或者inline SQL.
NewNamedGetFuncWith 创建一个 NamedGetFunc m: Factory 数据库管理器 db: 数据库名称 tpl: SQL模版或者inline SQL.
NewNamedSelectFunc 创建一个 NamedSelectFunc db: 数据库名称 tpl: SQL模版或者inline SQL.
NewNamedSelectFuncWith 创建一个 NamedSelectFunc manager: Factory 数据库管理器 db: 数据库名称 tpl: SQL模版或者inline SQL.
NewSelectFunc 创建一个 SelectFunc db: 数据库名称(使用默认的数据库管理器 StdFactory) tpl: SQL模版或者inline SQL.
NewSelectFuncWith 创建一个 SelectFunc m: Factory 数据库管理器 db: 数据库名称 tpl: SQL模版或者inline SQL.
NewTxFuncWith 创建一个 TxFunc db: 数据库名称 tpl: SQL模版或者inline SQL.
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

# Constants

TagDS 数据源.
TagReadonly 事务是否只读.
TagSQL sql模版(或inline sql).
TagTx 事务级别.
TxDefault 默认事务级别.
TxLinearizable 事务级别:Linearizable.
TxReadCommitted 事务级别:ReadCommitted.
TxReadUncommitted 事务级别:ReadUncommitted.
TxRepeatableRead 事务级别:RepeatableRead.
TxSerializable 事务级别:Serializable.
TxSnapshot 事务级别:Snapshot.
TxWriteCommitted 事务级别:WriteCommitted.

# Variables

ClearTemplateFS clear sql template from filesystem.
CreateAndSet initialize a db.
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
No description provided by the author
No description provided by the author
Get a db from.
No description provided by the author
MustGet a db,if db not exists,raise a panic.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Set a db.
SetConstructor set a db with constructors func.
SetTemplateFS set sql template from filesystem.
Shutdown manager and close all db.
No description provided by the author
StdFactory default connection manager.
No description provided by the author

# Structs

BaseMapper 基础的ORM功能 1.
DB 数据库连接 对sqlx.DB的封装,提供更多的功能: 1.
No description provided by the author
No description provided by the author
Tx transaction wrapper.

# Interfaces

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
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
ExecFunc Exec 函数类型, 用于执行无返回值的SQL.
GetFunc Get 函数类型, 用于查询单条记录.
NamedExecFunc NamedExec 函数类型, 用于执行无返回值的SQL,使用命名参数.
NamedGetFunc NamedGet 函数类型, 用于查询单条记录,使用命名参数.
NamedSelectFunc NamedSelect 函数类型, 用于查询多条记录,使用命名参数.
SelectFunc Select 函数类型,使用位置参数.
TxFunc Tx 函数类型, 用于执行事务.