Versions in this module Expand all Collapse all v0 v0.1.0 Dec 9, 2023 Changes in this version + const NameSpace + const SelectSetSuffix + func InName(i int, names []string) string + func OutName(i int) string + func StmtIdOf(id string) string + type Config struct + XmlScan string + func (it *Config) AddNs(ns string, xml string) + func (it *Config) AddPlugin(plugin Plugin) + func (it *Config) AddRsMap(id string, rsMap RsMap) + func (it *Config) AddStmt(stmt *Stmt) + func (it *Config) Factory() *Factory + func (it *Config) GetDB(id string) *sql.DB + func (it *Config) GetNsXml(ns string) string + func (it *Config) GetRsMap(id string) RsMap + func (it *Config) GetStmt(id string) *Stmt + func (it *Config) HasNs(ns string) bool + func (it *Config) MainDB() *sql.DB + func (it *Config) SetDB(id string, db *sql.DB) *Config + func (it *Config) SetMainDB(db *sql.DB) + type DBProxy interface + ExecContext func(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + PrepareContext func(ctx context.Context, query string) (*sql.Stmt, error) + QueryContext func(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + QueryRowContext func(ctx context.Context, query string, args ...interface{}) *sql.Row + type Factory struct + func (it *Factory) Keeper() *Keeper + func (it *Factory) Open() *Session + func (it *Factory) OpenTx() *Session + func (it *Factory) OpenTxWith(txOpts *sql.TxOptions) *Session + func (it *Factory) ResetKeeper() + type Hook = int + const Always + const ProcessArgs + const ProcessResults + const SqlQuery + type Keeper struct + Context context.Context + func (it *Keeper) Commit() + func (it *Keeper) Current() *Session + func (it *Keeper) Locked() bool + func (it *Keeper) Pop() + func (it *Keeper) Push(session *Session) + func (it *Keeper) Reuse() + func (it *Keeper) Rollback() + type Order = int + const After + const Before + type Payload struct + Args []reflect.Value + LastInsertId int64 + Result []reflect.Value + Sql string + SqlArgs []any + Stmt *Stmt + func (it *Payload) Cancel() + func (it *Payload) Put(key string, value any) + func (it *Payload) PutAll(val map[string]any) + type Plugin interface + Hook func() Hook + Id func() int + Intercept func(payload *Payload) bool + Order func() Order + type Proxy struct + func (it *Proxy) Invoker() reflect.Value + type RsMap = map[string][]string + type Session struct + func (it *Session) Commit() + func (it *Session) Exec(stmt *Stmt, sql string, values []any) (sql.Result, error) + func (it *Session) Query(stmt *Stmt, sql string, values []any) (*sql.Rows, error) + func (it *Session) Rollback() + type SetProxy struct + Basic bool + Bind string + Invoker reflect.Value + Props []any + SetMap map[string][]string + type Stmt struct + ArgNames []string + Bind string + DbId string + Dynamic bool + Id string + KeyColumns []string + KeyProps []string + Ns string + RsMaps []RsMap + SetStmts []*Stmt + SqlNode script.SqlNode + StmtType StmtType + Target Target + func (it *Stmt) DB() *sql.DB + func (it *Stmt) EvalSql(builder *script.SqlBuilder) (string, []any) + func (it *Stmt) ProxyOf(target reflect.Type, args ...string) *Proxy + func (it *Stmt) ProxyOfField(tf reflect.StructField) *Proxy + func (it *Stmt) Scan(dest any) + type StmtType uint + const Delete + const Insert + const Select + const SelectSet + const Update + type Target uint + const ARG + const CONTEXT + const RESULT