日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯網營銷解決方案
創(chuàng)新互聯GoFrame教程:GoFrame 鏈式操作-基本介紹

?gdb?鏈式操作使用方式簡單靈活,是?GOFrame?框架官方推薦的數據庫操作方式。鏈式操作可以通過數據庫對象的?db.Model?方法或者事務對象的?tx.Model?方法,基于指定的數據表返回一個鏈式操作對象?*Model?,該對象可以執(zhí)行以下方法。當前方法列表可能滯后于源代碼,詳細的方法列表請參考接口文檔: https://pkg.go.dev/github.com/gogf/gf/v2/database/gdb#Model

// 寫入/更新/刪除基本操作
func (m *Model) Insert(data ...interface{}) (result sql.Result, err error)
func (m *Model) InsertAndGetId(data ...interface{}) (lastInsertId int64, err error)
func (m *Model) InsertIgnore(data ...interface{}) (result sql.Result, err error)
func (m *Model) Replace(data ...interface{}) (result sql.Result, err error)
func (m *Model) Save(data ...interface{}) (result sql.Result, err error)
func (m *Model) Update(dataAndWhere ...interface{}) (result sql.Result, err error)
func (m *Model) Delete(where ...interface{}) (result sql.Result, err error)

// 基本查詢操作
func (m *Model) All(where ...interface{} (Result, error)
func (m *Model) One(where ...interface{}) (Record, error)
func (m *Model) Array(fieldsAndWhere ...interface{}) ([]Value, error)
func (m *Model) Value(fieldsAndWhere ...interface{}) (Value, error)
func (m *Model) Count(where ...interface{}) (int, error)
func (m *Model) CountColumn(column string) (int, error)

// 常用基本統計
func (m *Model) Min(column string) (float64, error)
func (m *Model) Max(column string) (float64, error)
func (m *Model) Avg(column string) (float64, error)
func (m *Model) Sum(column string) (float64, error)

// 字段自增/自減
func (m *Model) Increment(column string, amount float64) (sql.Result, error)
func (m *Model) Decrement(column string, amount float64) (sql.Result, error)

// 主鍵查詢操作
func (m *Model) FindAll(where ...interface{}) (Result, error)
func (m *Model) FindOne(where ...interface{}) (Record, error)
func (m *Model) FindArray(fieldsAndWhere ...interface{}) (Value, error)
func (m *Model) FindValue(fieldsAndWhere ...interface{}) (Value, error)
func (m *Model) FindCount(where ...interface{}) (int, error)
func (m *Model) FindScan(pointer interface{}, where ...interface{}) error

// 查詢轉換操作
func (m *Model) Struct(pointer interface{}) error
func (m *Model) Structs(pointer interface{}) error
func (m *Model) Scan(pointer interface{}) error
func (m *Model) ScanList(listPointer interface{}, attributeName string, relation ...string) (err error)

// 聯表查詢方法
func (m *Model) LeftJoin(table ...string) *Model
func (m *Model) RightJoin(table ...string) *Model
func (m *Model) InnerJoin(table ...string) *Model

// 聯合查詢
func (m *Model) Union(unions ...*Model) *Model
func (m *Model) UnionAll(unions ...*Model) *Model

// With關聯查詢
func (m *Model) With(object interface{}) *Model
func (m *Model) WithAll() *Model

// 條件查詢方法 
func (m *Model) Where(where interface{}, args...interface{}) *Model
func (m *Model) WherePri(where interface{}, args ...interface{}) *Model
func (m *Model) WhereBetween(column string, min, max interface{}) *Model
func (m *Model) WhereLike(column string, like interface{}) *Model
func (m *Model) WhereIn(column string, in interface{}) *Model
func (m *Model) WhereNull(columns ...string) *Model
func (m *Model) WhereLT(column string, value interface{}) *Model
func (m *Model) WhereLTE(column string, value interface{}) *Model
func (m *Model) WhereGT(column string, value interface{}) *Model
func (m *Model) WhereGTE(column string, value interface{}) *Model

func (m *Model) WhereNotBetween(column string, min, max interface{}) *Model
func (m *Model) WhereNotLike(column string, like interface{}) *Model
func (m *Model) WhereNotIn(column string, in interface{}) *Model
func (m *Model) WhereNotNull(columns ...string) *Model

func (m *Model) WhereOr(where interface{}, args ...interface{}) *Model
func (m *Model) WhereOrBetween(column string, min, max interface{}) *Model
func (m *Model) WhereOrLike(column string, like interface{}) *Model
func (m *Model) WhereOrIn(column string, in interface{}) *Model
func (m *Model) WhereOrNull(columns ...string) *Model
func (m *Model) WhereOrLT(column string, value interface{}) *Model 
func (m *Model) WhereOrLTE(column string, value interface{}) *Model 
func (m *Model) WhereOrGT(column string, value interface{}) *Model 
func (m *Model) WhereOrGTE(column string, value interface{}) *Model

func (m *Model) WhereOrNotBetween(column string, min, max interface{}) *Model
func (m *Model) WhereOrNotLike(column string, like interface{}) *Model
func (m *Model) WhereOrNotIn(column string, in interface{}) *Model
func (m *Model) WhereOrNotNull(columns ...string) *Model

// 分組排序方法
func (m *Model) Group(group string) *Model
func (m *Model) Order(order string) *Model
func (m *Model) OrderAsc(column string) *Model
func (m *Model) OrderDesc(column string) *Model
func (m *Model) OrderRandom() *Model

// 條件過濾方法
func (m *Model) Fields(fields string) *Model
func (m *Model) FieldsEx(fields string) *Model
func (m *Model) Data(data...interface{}) *Model
func (m *Model) Batch(batch int) *Model
func (m *Model) Filter() *Model
func (m *Model) Safe(safe...bool) *Model
func (m *Model) Having(having interface{}, args ...interface{}) *Model
func (m *Model) Offset(offset int) *Model
func (m *Model) Limit(start int, limit int) *Model
func (m *Model) OmitEmpty() *Model
func (m *Model) Page(page, limit int) (*Model)
func (m *Model) Distinct() *Model

// 數據庫/事務切換
func (m *Model) DB(db DB) *Model
func (m *Model) TX(tx *TX) *Model

// 主從自定義切換
func (m *Model) Master() *Model
func (m *Model) Slave() *Model

// 數據互斥鎖操作
func (m *Model) LockUpdate() *Model
func (m *Model) LockShared() *Model

// 常用工具方法
func (m *Model) Ctx(ctx context.Context) *Model
func (m *Model) Clone() *Model
func (m *Model) Cache(duration time.Duration, name ...string) *Model 
func (m *Model) As(as string) *Model
func (m *Model) Chunk(limit int, callback func(result Result, err error) bool)
func (m *Model) Schema(schema string) *Model
func (m *Model) Option(option int) *Model
func (m *Model) Args(args ...interface{}) *Model
func (m *Model) Unscoped() *Model
func (m *Model) HasField(field string) (bool, error)
func (m *Model) GetFieldsStr(prefix ...string) string
func (m *Model) GetFieldsExStr(fields string, prefix ...string) string

分享題目:創(chuàng)新互聯GoFrame教程:GoFrame 鏈式操作-基本介紹
網址分享:http://m.5511xx.com/article/dhcdojp.html