Documentation ¶
Index ¶
- func Disable(mds ...IModel)
- func Init(confs []*Config) (err error)
- func Register(md IModel)
- type Builder
- func (b *Builder) And(cond builder.Cond) *Builder
- func (b *Builder) Asc(colNames ...string)
- func (b *Builder) CrossJoin(joinTable interface{}, joinCond interface{}) *Builder
- func (b *Builder) Delete(conds ...builder.Cond) *Builder
- func (b *Builder) Desc(colNames ...string)
- func (b *Builder) From(table interface{}) *Builder
- func (b *Builder) FullJoin(joinTable interface{}, joinCond interface{}) *Builder
- func (b *Builder) GroupBy(groupBy string)
- func (b *Builder) InnerJoin(joinTable interface{}, joinCond interface{}) *Builder
- func (b *Builder) Insert(eq builder.Eq) *Builder
- func (b *Builder) Into(table interface{}) *Builder
- func (b *Builder) Join(joinType string, joinTable interface{}, joinCond interface{}) *Builder
- func (b *Builder) LeftJoin(joinTable interface{}, joinCond interface{}) *Builder
- func (b *Builder) Or(cond builder.Cond) *Builder
- func (b *Builder) OrderBy(orderBy string)
- func (b *Builder) RightJoin(joinTable interface{}, joinCond interface{}) *Builder
- func (b *Builder) Select(cols ...string) *Builder
- func (b *Builder) Update(updates ...builder.Cond) *Builder
- func (b *Builder) Where(cond builder.Cond) *Builder
- type Config
- type DA
- func (da *DA[T]) Asc(colNames ...string) *xorm.Session
- func (da *DA[T]) Desc(colNames ...string) *xorm.Session
- func (da *DA[T]) GetModel() (md T)
- func (da *DA[T]) GetModelList(page, pageSize int, itemsOpt ...[]T) (ml *ModelList[T], err error)
- func (da *DA[T]) GetModelListByBuilder(builder *Builder, page, pageSize int, itemsOpt ...[]T) (ml *ModelList[T], err error)
- func (da *DA[T]) GetModelListByBuilderWithPageOffset(builder *Builder, page, pageSize, pageOffset int, itemsOpt ...[]T) (ml *ModelList[T], err error)
- func (da *DA[T]) GetModelListWithPageOffset(page, pageSize, pageOffset int, itemsOpt ...[]T) (ml *ModelList[T], err error)
- func (da *DA[T]) GroupBy(keys string) *xorm.Session
- func (da *DA[T]) OrderBy(order string) *xorm.Session
- func (da *DA[T]) SetModel(md T)
- func (da *DA[T]) UpdateByBuilder(builder *Builder) (rows int64, err error)
- func (da *DA[T]) UpdateByModel(imdOpt ...IModel) (int64, error)
- type Engine
- type IModel
- type Model
- func (m *Model) FieldMarks() []string
- func (m *Model) HasFieldMark(fieldName string) bool
- func (m *Model) HasPropertyMark(markKey string) bool
- func (m *Model) PropertyMarks() []string
- func (m *Model) ResetFieldMark()
- func (m *Model) ResetMark()
- func (m *Model) ResetPropertyMark()
- func (m *Model) SetFieldMark(fieldName string, isMark ...bool)
- func (m *Model) SetPropertyMark(markKey string, isMark ...bool)
- type ModelList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
func NewBuilder ¶
func NewBuilder() *Builder
func NewMySQLBuilder ¶
func NewMySQLBuilder() *Builder
type Config ¶
type Config struct { Alias string `json:"alias"` Type string `json:"type"` Server string `json:"server"` Port int `json:"port"` Database string `json:"database"` User string `json:"user"` Password string `json:"password"` IsShowSQL bool `json:"isShowSQL"` // 是否打印 SQL 语句 LogLevel string `json:"logLevel"` // logger 日志级别,支持:debug、info、warn、error、off,默认:off // contains filtered or unexported fields }
Config 数据库配置
type DA ¶
DA 数据库操作对象
func (*DA[T]) GetModelList ¶
GetModelList 获取列表数据,items可指定接收查询结果的结构对象
func (*DA[T]) GetModelListByBuilder ¶
func (da *DA[T]) GetModelListByBuilder(builder *Builder, page, pageSize int, itemsOpt ...[]T) (ml *ModelList[T], err error)
GetModelListByBuilder 获取列表数据,通过Builder构建查询,items可指定接收查询结果的结构对象
func (*DA[T]) GetModelListByBuilderWithPageOffset ¶
func (da *DA[T]) GetModelListByBuilderWithPageOffset(builder *Builder, page, pageSize, pageOffset int, itemsOpt ...[]T) (ml *ModelList[T], err error)
GetModelListByBuilderWithPageOffset 获取列表数据,通过Builder构建查询,items可指定接收查询结果的结构对象
func (*DA[T]) GetModelListWithPageOffset ¶
func (da *DA[T]) GetModelListWithPageOffset(page, pageSize, pageOffset int, itemsOpt ...[]T) (ml *ModelList[T], err error)
GetModelListWithPageOffset 获取列表数据,items可指定接收查询结果的结构对象
func (*DA[T]) UpdateByBuilder ¶
UpdateByBuilder 使用Builder进行更新
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model orm基础模型 与定制的 easyjson 搭配使用
func (*Model) HasFieldMark ¶
HasFieldMark 指定的字段名称是否已赋值
func (*Model) HasPropertyMark ¶
HasPropertyMark 指定的字段名称是否已赋值
func (*Model) ResetFieldMark ¶
func (m *Model) ResetFieldMark()
ResetFieldMark 重置所有字段的赋值标识为:false,字段内容并不会清空
func (*Model) ResetPropertyMark ¶
func (m *Model) ResetPropertyMark()
ResetPropertyMark 重置所有字段的赋值标识为:false,字段内容并不会清空
func (*Model) SetFieldMark ¶
SetFieldMark 设置字段的赋值标识,isMark不传时,默认:true
func (*Model) SetPropertyMark ¶
SetPropertyMark 设置字段的赋值标识,isMark不传时,默认:true
Click to show internal directories.
Click to hide internal directories.