Documentation ¶
Index ¶
- type Builder
- func (b *Builder) Delete(tableName string, where map[string]interface{}) (string, []interface{}, error)
- func (b *Builder) Insert(tableName string, columns []string, data ...[]interface{}) (string, []interface{}, error)
- func (b *Builder) Query(tableName string, params map[string]interface{}) (string, []interface{}, error)
- func (b *Builder) Update(tableName string, data, where map[string]interface{}) (string, []interface{}, error)
- func (b *Builder) Where(where map[string]interface{}) (string, []interface{})
- type Executor
- func (exec *Executor) Close()
- func (exec *Executor) Connect(execName, dns string) (bool, error)
- func (exec *Executor) Execute(sql string, args ...interface{}) (int64, int64)
- func (exec *Executor) GetDB() *sql.DB
- func (exec *Executor) IsCacheEngineOK() bool
- func (exec *Executor) Query(sql string, args ...interface{}) *sql.Rows
- func (exec *Executor) QueryCache(cacheOpt map[string]interface{}, sql string, args ...interface{}) ([]map[string]interface{}, error)
- func (exec *Executor) SetCacheEngine(cache cache.Cache)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct{}
Builder sql query builder
var DefaultBuilder Builder
type Executor ¶
type Executor struct { Log *utils.CombinedLogger Debug bool // contains filtered or unexported fields }
Executor Database Driver
func (*Executor) Connect ¶
Connect db
@params execName, including mysql, sqlite3 @params dns, format:user:password@tpc(host:port)/databaseName?options
func (*Executor) Execute ¶
Execute sql, including insert, delete and update @return (int64 number of row affected,int64 the latest record id)
func (*Executor) QueryCache ¶
func (exec *Executor) QueryCache(cacheOpt map[string]interface{}, sql string, args ...interface{}) ([]map[string]interface{}, error)
QueryCache @params cacheOpt @params sql @params arg
func (*Executor) SetCacheEngine ¶
SetCacheEngine
Click to show internal directories.
Click to hide internal directories.