Documentation ¶
Overview ¶
Copyright 2021 utils. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Index ¶
- func CreateTables(v interface{})
- func DB() *gorm.DB
- func DbCount(model, where interface{}) int64
- func DbCreate(model interface{}) error
- func DbDeleteBy(model interface{}, where string, args ...interface{}) (count int64, err error)
- func DbDeleteByIds(model, ids interface{}) error
- func DbDeletes(value interface{}) error
- func DbFind(out interface{}, orders ...string) error
- func DbFindBy(out interface{}, where string, args ...interface{}) (int64, error)
- func DbFindPage(query string, obj interface{}, page, size int) (int64, error)
- func DbFirstBy(out interface{}, where string, args ...interface{}) (err error)
- func DbFirstByID(out interface{}, id uint) error
- func DbFirstWhere(out, where interface{}) error
- func DbSave(value interface{}) error
- func DbUpdateByID(model, id interface{}) error
- func DbUpdateByIds(model interface{}, ids interface{}, value map[string]interface{}) error
- func DbUpdateColByID(model, id interface{}, column string, value interface{}) error
- func DbUpdateModel(model interface{}) error
- func DbUpdateModelBy(model interface{}, where string, args ...interface{}) error
- func Model(v interface{}) *gorm.DB
- func NewGormV2(name, address string) (db *gorm.DB, err error)
- func Partition(m interface{}) *partition
- func SetDB(db *gorm.DB)
- func Table(v interface{}) *gorm.DB
- type DbPage
- type DbWhere
- func (o *DbWhere) Add(query string, args ...interface{}) *DbWhere
- func (o *DbWhere) DateRange(field string, r []string) *DbWhere
- func (o *DbWhere) Equal(field string, v interface{}) *DbWhere
- func (o *DbWhere) EqualNumber(field, v string) *DbWhere
- func (o *DbWhere) Find(out interface{}, conds ...interface{}) (int64, error)
- func (o *DbWhere) In(query, values string) *DbWhere
- func (o *DbWhere) Joins(query string, args ...interface{}) *DbWhere
- func (o *DbWhere) Like(field, v string) *DbWhere
- func (o *DbWhere) Model(m interface{}) *DbWhere
- func (o *DbWhere) Preload(preloads ...string) *DbWhere
- func (o *DbWhere) PreloadWith(query string, args ...interface{}) *DbWhere
- func (o *DbWhere) Scan(out interface{}) (int64, error)
- func (o *DbWhere) TimeRange(field string, st, et string) *DbWhere
- type H
- type XTablers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DbDeleteBy ¶
DbDeleteBy 删除
func DbDeleteByIds ¶
func DbDeleteByIds(model, ids interface{}) error
DbDeleteByIds 批量删除 ids id数组 []
func DbFindPage ¶
DbFindPageRaw obj必须是数组类型
func DbUpdateByIds ¶
DbUpdateByIds 批量更新 ids id数组
func DbUpdateColByID ¶
DbUpdateColByID 单列更新
func DbUpdateModelBy ¶
DbUpdateModelBy 条件更新
Types ¶
Click to show internal directories.
Click to hide internal directories.