Documentation ¶
Index ¶
- func InKeys(numArgs int) string
- func RegisterSSL(name, ca, cert, key string, insecure bool)
- func SetEncryptKeys(key, iv []byte)
- type DB
- func (db *DB) Begin() *Tx
- func (db *DB) CopyByLogger(logger *log.Logger) *DB
- func (db *DB) Delete(table string, wheres string, args ...interface{}) *ExecResult
- func (db *DB) Destroy() error
- func (db *DB) Exec(requestSql string, args ...interface{}) *ExecResult
- func (db *DB) GetLogger() *log.Logger
- func (db *DB) GetOriginDB() *sql.DB
- func (db *DB) InKeys(numArgs int) string
- func (db *DB) Insert(table string, data interface{}) *ExecResult
- func (db *DB) Prepare(requestSql string) *Stmt
- func (db *DB) Query(requestSql string, args ...interface{}) *QueryResult
- func (db *DB) Replace(table string, data interface{}) *ExecResult
- func (db *DB) SetLogger(logger *log.Logger)
- func (db *DB) Update(table string, data interface{}, wheres string, args ...interface{}) *ExecResult
- type ExecResult
- type QueryResult
- func (r *QueryResult) Complete()
- func (r *QueryResult) FloatOnR1C1() float64
- func (r *QueryResult) IntOnR1C1() int64
- func (r *QueryResult) IntsOnC1() []int64
- func (r *QueryResult) MapOnR1() map[string]interface{}
- func (r *QueryResult) MapResults() []map[string]interface{}
- func (r *QueryResult) SliceResults() [][]interface{}
- func (r *QueryResult) StringMapOnR1() map[string]string
- func (r *QueryResult) StringMapResults() []map[string]string
- func (r *QueryResult) StringOnR1C1() string
- func (r *QueryResult) StringSliceResults() [][]string
- func (r *QueryResult) StringsOnC1() []string
- func (r *QueryResult) To(result interface{}) error
- func (r *QueryResult) ToKV(target interface{}) error
- type Stmt
- type Tx
- func (tx *Tx) CheckFinished() error
- func (tx *Tx) Commit() error
- func (tx *Tx) Delete(table string, wheres string, args ...interface{}) *ExecResult
- func (tx *Tx) Exec(requestSql string, args ...interface{}) *ExecResult
- func (tx *Tx) Finish(ok bool) error
- func (tx *Tx) Insert(table string, data interface{}) *ExecResult
- func (tx *Tx) Prepare(requestSql string) *Stmt
- func (tx *Tx) Query(requestSql string, args ...interface{}) *QueryResult
- func (tx *Tx) Replace(table string, data interface{}) *ExecResult
- func (tx *Tx) Rollback() error
- func (tx *Tx) Update(table string, data interface{}, wheres string, args ...interface{}) *ExecResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSSL ¶ added in v0.5.49
func SetEncryptKeys ¶
func SetEncryptKeys(key, iv []byte)
Types ¶
type DB ¶
type DB struct { Config *dbInfo Error error // contains filtered or unexported fields }
func (*DB) Delete ¶ added in v0.6.0
func (db *DB) Delete(table string, wheres string, args ...interface{}) *ExecResult
func (*DB) Exec ¶
func (db *DB) Exec(requestSql string, args ...interface{}) *ExecResult
func (*DB) GetOriginDB ¶
func (*DB) Insert ¶
func (db *DB) Insert(table string, data interface{}) *ExecResult
func (*DB) Query ¶
func (db *DB) Query(requestSql string, args ...interface{}) *QueryResult
func (*DB) Replace ¶
func (db *DB) Replace(table string, data interface{}) *ExecResult
type ExecResult ¶
type ExecResult struct { Sql *string Args []interface{} Error error // contains filtered or unexported fields }
func (*ExecResult) Changes ¶
func (r *ExecResult) Changes() int64
func (*ExecResult) Id ¶
func (r *ExecResult) Id() int64
type QueryResult ¶
type QueryResult struct { Sql *string Args []interface{} Error error // contains filtered or unexported fields }
func (*QueryResult) Complete ¶ added in v0.5.43
func (r *QueryResult) Complete()
func (*QueryResult) FloatOnR1C1 ¶ added in v0.5.33
func (r *QueryResult) FloatOnR1C1() float64
func (*QueryResult) IntOnR1C1 ¶
func (r *QueryResult) IntOnR1C1() int64
func (*QueryResult) IntsOnC1 ¶
func (r *QueryResult) IntsOnC1() []int64
func (*QueryResult) MapOnR1 ¶
func (r *QueryResult) MapOnR1() map[string]interface{}
func (*QueryResult) MapResults ¶
func (r *QueryResult) MapResults() []map[string]interface{}
func (*QueryResult) SliceResults ¶
func (r *QueryResult) SliceResults() [][]interface{}
func (*QueryResult) StringMapOnR1 ¶ added in v0.5.49
func (r *QueryResult) StringMapOnR1() map[string]string
func (*QueryResult) StringMapResults ¶
func (r *QueryResult) StringMapResults() []map[string]string
func (*QueryResult) StringOnR1C1 ¶
func (r *QueryResult) StringOnR1C1() string
func (*QueryResult) StringSliceResults ¶
func (r *QueryResult) StringSliceResults() [][]string
func (*QueryResult) StringsOnC1 ¶
func (r *QueryResult) StringsOnC1() []string
func (*QueryResult) To ¶
func (r *QueryResult) To(result interface{}) error
func (*QueryResult) ToKV ¶ added in v0.1.7
func (r *QueryResult) ToKV(target interface{}) error
type Stmt ¶
type Stmt struct { Error error // contains filtered or unexported fields }
func (*Stmt) Exec ¶
func (stmt *Stmt) Exec(args ...interface{}) *ExecResult
type Tx ¶
type Tx struct { Error error // contains filtered or unexported fields }
func (*Tx) CheckFinished ¶ added in v0.5.51
func (*Tx) Delete ¶ added in v0.6.0
func (tx *Tx) Delete(table string, wheres string, args ...interface{}) *ExecResult
func (*Tx) Exec ¶
func (tx *Tx) Exec(requestSql string, args ...interface{}) *ExecResult
func (*Tx) Insert ¶
func (tx *Tx) Insert(table string, data interface{}) *ExecResult
func (*Tx) Query ¶
func (tx *Tx) Query(requestSql string, args ...interface{}) *QueryResult
func (*Tx) Replace ¶
func (tx *Tx) Replace(table string, data interface{}) *ExecResult
Click to show internal directories.
Click to hide internal directories.