Documentation
¶
Index ¶
- Variables
- func Converter(sqlType string) func(interface{}) interface{}
- type Config
- type RestOrm
- func (t *RestOrm) ColTs() map[string]map[string]map[string]string
- func (t *RestOrm) DbConfigAdd(name string, cfg *Config)
- func (t *RestOrm) DbConfigDelete(name string)
- func (t *RestOrm) DbConfigUpdate(name string, cfg *Config) (err error)
- func (t *RestOrm) DbStats() map[string]sql.DBStats
- func (t *RestOrm) DbUpdate(name string) (err error)
- func (t *RestOrm) Import(name string, f io.Reader) (res []sql.Result, err error)
- func (t *RestOrm) ResCount(dbName, tbName string, filter ...interface{}) (c int64, err error)
- func (t *RestOrm) ResCreateMany(dbName, tbName string, dts ...map[string]interface{}) (err error)
- func (t *RestOrm) ResDeleteMany(dbName, tbName string, filter ...interface{}) (err error)
- func (t *RestOrm) ResGetMany(dbName, tbName string, fields string, groupBy string, order string, ...) (dts []map[string]interface{}, err error)
- func (t *RestOrm) ResUpdateMany(dbName, tbName string, data map[string]interface{}, filter ...interface{}) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Errs = struct { DbCreateError string DbDeleteError string DbUpdateError string DbCountError string DbGetError string DbDeleteOneError string DbUpdateOneError string DbGetOneError string }{ DbCreateError: "db_create_error", DbDeleteError: "db_delete_error", DbUpdateError: "db_update_error", DbCountError: "db_count_error", DbGetError: "db_get_error", DbDeleteOneError: "db_delete_one_error", DbUpdateOneError: "db_update_one_error", DbGetOneError: "db_get_one_error", }
Functions ¶
Types ¶
type Config ¶
type Config struct {
Enable bool `toml:"enable" json:"enable"`
Driver string `toml:"driver" json:"driver"`
Dsn string `toml:"dsn" json:"dsn"`
MaxOpenConns int `toml:"max_open_conns" json:"max_open_conns"`
MaxIdleConns int `toml:"max_idle_conns" json:"max_idle_conns"`
MaxLifetime int `toml:"max_lefttime" json:"max_lefttime"`
ShowSql bool `toml:"show_sql" json:"show_sql"`
// contains filtered or unexported fields
}
Config is database connection configuration
type RestOrm ¶
type RestOrm struct {
// contains filtered or unexported fields
}
func (*RestOrm) DbConfigAdd ¶
func (*RestOrm) DbConfigDelete ¶
func (*RestOrm) DbConfigUpdate ¶
func (*RestOrm) ResCreateMany ¶
创建记录
func (*RestOrm) ResDeleteMany ¶
删除记录
Click to show internal directories.
Click to hide internal directories.