Documentation ¶
Index ¶
- Constants
- func Configure(cfg Map)
- func Field(name string, field string, exts ...Any) Var
- func Fields(name string, keys []string, exts ...Vars) Vars
- func Go()
- func Models() map[string]Model
- func Option(name string, field string, key string) Any
- func Options(name string, field string) Map
- func ParseSQL(args ...Any) (string, []Any, string, error)
- func Ready()
- func Register(name string, value Any, overrides ...bool)
- func Tables() map[string]Table
- func Trigger(name string, values ...Map)
- func Views() map[string]View
- type BatchFunc
- type Config
- type Configs
- type Connect
- type DataBase
- type DataModel
- type DataTable
- type DataView
- type Driver
- type Health
- type Instance
- type Model
- type Module
- func (this *Module) Base(names ...string) DataBase
- func (this *Module) Config(name string, config Config, override bool)
- func (this *Module) Configs(config Configs, override bool)
- func (this *Module) Configure(global Map)
- func (this *Module) Connect()
- func (module *Module) Driver(name string, driver Driver, override bool)
- func (this *Module) Field(name string, field string, extends ...Any) Var
- func (this *Module) Fields(name string, keys []string, extends ...Vars) Vars
- func (this *Module) Initialize()
- func (this *Module) Instance(names ...string) Instance
- func (this *Module) Launch()
- func (this *Module) Model(name string, config Model, override bool)
- func (this *Module) ModelConfig(name string) *Model
- func (this *Module) ModelFields(name string, keys []string, exts ...Vars) Vars
- func (this *Module) ModelOptions(name, field string) Map
- func (this *Module) Models() map[string]Model
- func (this *Module) Option(name, field, key string) Any
- func (this *Module) Options(name, field string) Map
- func (this *Module) Parse(args ...Any) (string, []Any, string, error)
- func (this *Module) Register(key string, value Any, override bool)
- func (this *Module) Table(name string, config Table, override bool)
- func (this *Module) TableConfig(name string) *Table
- func (this *Module) TableFields(name string, keys []string, extends ...Vars) Vars
- func (this *Module) TableOptions(name, field string) Map
- func (this *Module) Tables() map[string]Table
- func (this *Module) Terminate()
- func (this *Module) View(name string, config View, override bool)
- func (this *Module) ViewConfig(name string) *View
- func (this *Module) ViewFields(name string, keys []string, exts ...Vars) Vars
- func (this *Module) ViewOptions(name, field string) Map
- func (this *Module) Views() map[string]View
- type Relate
- type Table
- type View
Constants ¶
View Source
const ( CreateTrigger = "$.data.create" ChangeTrigger = "$.data.change" RemoveTrigger = "$.data.remove" RecoverTrigger = "$.data.recover" )
View Source
const (
NAME = "DATA"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataBase ¶
type DataModel ¶
type DataModel interface { First(args ...Any) Map Query(args ...Any) []Map }
数据模型接口
type DataTable ¶
type DataTable interface { Create(Map) Map Change(Map, Map) Map Remove(...Any) Map Update(sets Map, args ...Any) int64 Delete(args ...Any) int64 Entity(Any) Map Count(args ...Any) float64 First(args ...Any) Map Query(args ...Any) []Map Limit(offset, limit Any, args ...Any) (int64, []Map) Group(field string, args ...Any) []Map }
type DataView ¶
type DataView interface { Count(args ...Any) float64 First(args ...Any) Map Query(args ...Any) []Map Limit(offset, limit Any, args ...Any) (int64, []Map) Group(field string, args ...Any) []Map }
数据视图接口
type Model ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) Initialize ¶
func (this *Module) Initialize()
func (*Module) ModelConfig ¶
func (*Module) ModelFields ¶
func (*Module) ModelOptions ¶
func (*Module) Parse ¶
查询语法解析器 字段包裹成 $field$ 请自行处理 如mysql为反引号`field`,postgres, oracle为引号"field", 所有参数使用问号(?)表示 postgres驱动需要自行处理转成 $1,$2这样的 oracle驱动需要自行处理转成 :1 :2这样的 mongodb不适用,需驱动自己实现
func (*Module) TableConfig ¶
func (*Module) TableFields ¶
func (*Module) TableOptions ¶
2021-03-04支持一级子字段的option
func (*Module) ViewConfig ¶
func (*Module) ViewFields ¶
func (*Module) ViewOptions ¶
Click to show internal directories.
Click to hide internal directories.