Documentation
¶
Index ¶
- func GetModelFields(m IModel) map[string]QueryField
- func GetQueryFields(m IModel, rule string, selectFields ...interface{}) (string, [][]string)
- func Query(query xorm.IOrm, m IModel, rule string, selects ...interface{}) xorm.IOrm
- func Select(db xorm.IOrm, m IModel, rule string, selects ...interface{}) xorm.IOrm
- type IModel
- type IModelMutation
- type IModelQuery
- type IModelRelation
- type Model
- type QueryField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetQueryFields ¶
选择查询模型字段列表
Types ¶
type IModelMutation ¶
数据变动规则
type IModelQuery ¶
type IModelRelation ¶
type IModelRelation interface {
// 获取连接类型
GetJoin() string
// 获取关联模型
GetModel() IModel
// 获取关系
GetRelation() string
// 获取查询表达式
GetExpress() string
// rule
GetRule() string
}
实体模型关系接口
func NewModelRelation ¶
type QueryField ¶
type QueryField interface {
// 获取规则
GetRules() []string
// 检查是否存在规则
HasRule(rule string) bool
// 获取字段查询表达式
GetExpress() string
// 获取关系表
GetJoinTable() string
GetTableAlias() string
// 获取关系表达式
GetJoin() []string
}
func NewQueryField ¶
func NewQueryField(rules string, express string, joinTable string, alias string, join []string) QueryField
创建查询字段
Click to show internal directories.
Click to hide internal directories.