Documentation ¶
Index ¶
- Constants
- func IsNotFoundError(err error) bool
- func Mapping(data interface{}) map[string]interface{}
- func Scan(rs *sql.Rows, target interface{}) error
- func ScanToMap(rs *sql.Rows) ([]map[string]interface{}, error)
- type DB
- func (db *DB) Begin() (*Tx, error)
- func (db *DB) BeginCtx(ctx context.Context, opts *TxOptions) (*Tx, error)
- func (db *DB) Close() error
- func (db *DB) Count(name string, where Where, col string) (int64, error)
- func (db *DB) Delete(name string, where Where) (int64, error)
- func (db *DB) Insert(name string, data map[string]interface{}) (int64, error)
- func (db *DB) Modify(name string, where Where, update map[string]interface{}) (int64, error)
- func (db *DB) MultiInsert(name string, data []map[string]interface{}) (int64, error)
- func (db *DB) Select(name string, where Where, fields Fields) *Fruit
- type Fields
- type Fruit
- type Options
- type Tx
- func (tx *Tx) Commit() error
- func (tx *Tx) Delete(name string, where Where) (int64, error)
- func (tx *Tx) Insert(name string, data map[string]interface{}) (int64, error)
- func (tx *Tx) Modify(name string, where Where, update map[string]interface{}) (int64, error)
- func (tx *Tx) MultiInsert(name string, data []map[string]interface{}) (int64, error)
- func (tx *Tx) Rollback() error
- func (tx *Tx) RollbackSavePoint(tag string) error
- func (tx *Tx) Select(name string, where Where, fields Fields) *Fruit
- func (tx *Tx) SetSavePoint() (string, error)
- type TxOptions
- type Where
Constants ¶
View Source
const TagName = "sqler"
Variables ¶
This section is empty.
Functions ¶
func IsNotFoundError ¶
Types ¶
type DB ¶
func (*DB) MultiInsert ¶
MultiInsert 多行插入
type Fruit ¶
type Fruit struct {
// contains filtered or unexported fields
}
func (*Fruit) ConvertToMap ¶
type Options ¶
type Options struct { Driver string `yaml:"driver" mapstructure:"driver"` ConnStr string `yaml:"dsn" mapstructure:"dsn"` // 定时保活 KeepAlive int `yaml:"keep_alive" mapstructure:"keep_alive"` // 最大可空闲连接数量 MaxIdles int `yaml:"max_idles" mapstructure:"max_idles"` // 最大连接数量 MaxOpens int `yaml:"max_opens" mapstructure:"max_opens"` MaxLifeTime int `yaml:"max_life_time" mapstructure:"max_life_time"` }
type Tx ¶
Tx 事务
func (*Tx) MultiInsert ¶
MultiInsert 插入多行
func (*Tx) RollbackSavePoint ¶
RollbackSavePoint 回滚到指定 SavePoint
func (*Tx) SetSavePoint ¶
SetSavePoint Create SavePoint
Click to show internal directories.
Click to hide internal directories.