Versions in this module Expand all Collapse all v2 v2.4.4 May 27, 2023 v2.4.3 May 27, 2023 v2.4.2 May 26, 2023 Changes in this version + const DefaultGroupName + const InsertOptionDefault + const InsertOptionIgnore + const InsertOptionReplace + const InsertOptionSave + const LocalTypeBool + const LocalTypeBytes + const LocalTypeDate + const LocalTypeDatetime + const LocalTypeFloat32 + const LocalTypeFloat64 + const LocalTypeInt + const LocalTypeInt64 + const LocalTypeInt64Bytes + const LocalTypeInt64Slice + const LocalTypeIntSlice + const LocalTypeJson + const LocalTypeJsonb + const LocalTypeString + const LocalTypeUint + const LocalTypeUint64 + const LocalTypeUint64Bytes + const LocalTypeUint64Slice + const OrmTagForDo + const OrmTagForStruct + const OrmTagForTable + const OrmTagForWith + const OrmTagForWithOrder + const OrmTagForWithWhere + const SqlTypeBegin + const SqlTypeExecContext + const SqlTypePrepareContext + const SqlTypeQueryContext + const SqlTypeStmtExecContext + const SqlTypeStmtQueryContext + const SqlTypeStmtQueryRowContext + const SqlTypeTXCommit + const SqlTypeTXRollback + func AddConfigNode(group string, node ConfigNode) + func AddDefaultConfigGroup(nodes ConfigGroup) + func AddDefaultConfigNode(node ConfigNode) + func CatchSQL(ctx context.Context, f func(ctx context.Context) error) (sqlArray []string, err error) + func DataToMapDeep(value interface{}) map[string]interface + func FormatSqlWithArgs(sql string, args []interface{}) string + func GetDefaultGroup() string + func GetInsertOperationByOption(option int) string + func GetPrimaryKeyCondition(primary string, where ...interface{}) (newWhereCondition []interface{}) + func IsConfigured() bool + func ListItemValues(list interface{}, key interface{}, subKey ...interface{}) (values []interface{}) + func ListItemValuesUnique(list interface{}, key string, subKey ...interface{}) []interface + func Register(name string, driver Driver) error + func SetConfig(config Config) + func SetConfigGroup(group string, nodes ConfigGroup) + func SetDefaultGroup(name string) + func ToSQL(ctx context.Context, f func(ctx context.Context) error) (sql string, err error) + func WithDB(ctx context.Context, db DB) context.Context + func WithTX(ctx context.Context, tx TX) context.Context + type CacheOption struct + Duration time.Duration + Force bool + Name string + type CatchSQLManager struct + DoCommit bool + SQLArray *garray.StrArray + type ChunkHandler func(result Result, err error) bool + type Config map[string]ConfigGroup + type ConfigGroup []ConfigNode + func GetConfig(group string) ConfigGroup + type ConfigNode struct + Charset string + CreatedAt string + Debug bool + DeletedAt string + DryRun bool + ExecTimeout time.Duration + Extra string + Host string + Link string + MaxConnLifeTime time.Duration + MaxIdleConnCount int + MaxOpenConnCount int + Name string + Namespace string + Pass string + Port string + Prefix string + PrepareTimeout time.Duration + Protocol string + QueryTimeout time.Duration + Role string + TimeMaintainDisabled bool + Timezone string + TranTimeout time.Duration + Type string + UpdatedAt string + User string + Weight int + type Core struct + func (c *Core) Begin(ctx context.Context) (tx TX, err error) + func (c *Core) CheckLocalTypeForField(ctx context.Context, fieldType string, fieldValue interface{}) (string, error) + func (c *Core) ClearCache(ctx context.Context, table string) (err error) + func (c *Core) ClearCacheAll(ctx context.Context) (err error) + func (c *Core) ClearTableFields(ctx context.Context, table string, schema ...string) (err error) + func (c *Core) ClearTableFieldsAll(ctx context.Context) (err error) + func (c *Core) Close(ctx context.Context) (err error) + func (c *Core) ConvertDataForRecord(ctx context.Context, value interface{}) (map[string]interface{}, error) + func (c *Core) ConvertDataForRecordValue(ctx context.Context, value interface{}) (interface{}, error) + func (c *Core) ConvertValueForLocal(ctx context.Context, fieldType string, fieldValue interface{}) (interface{}, error) + func (c *Core) Ctx(ctx context.Context) DB + func (c *Core) Delete(ctx context.Context, table string, condition interface{}, args ...interface{}) (result sql.Result, err error) + func (c *Core) DoCommit(ctx context.Context, in DoCommitInput) (out DoCommitOutput, err error) + func (c *Core) DoDelete(ctx context.Context, link Link, table string, condition string, ...) (result sql.Result, err error) + func (c *Core) DoExec(ctx context.Context, link Link, sql string, args ...interface{}) (result sql.Result, err error) + func (c *Core) DoFilter(ctx context.Context, link Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error) + func (c *Core) DoInsert(ctx context.Context, link Link, table string, list List, option DoInsertOption) (result sql.Result, err error) + func (c *Core) DoPrepare(ctx context.Context, link Link, sql string) (stmt *Stmt, err error) + func (c *Core) DoQuery(ctx context.Context, link Link, sql string, args ...interface{}) (result Result, err error) + func (c *Core) DoSelect(ctx context.Context, link Link, sql string, args ...interface{}) (result Result, err error) + func (c *Core) DoUpdate(ctx context.Context, link Link, table string, data interface{}, ...) (result sql.Result, err error) + func (c *Core) Exec(ctx context.Context, sql string, args ...interface{}) (result sql.Result, err error) + func (c *Core) FilteredLink() string + func (c *Core) GetAll(ctx context.Context, sql string, args ...interface{}) (Result, error) + func (c *Core) GetArray(ctx context.Context, sql string, args ...interface{}) ([]Value, error) + func (c *Core) GetCache() *gcache.Cache + func (c *Core) GetChars() (charLeft string, charRight string) + func (c *Core) GetConfig() *ConfigNode + func (c *Core) GetCore() *Core + func (c *Core) GetCount(ctx context.Context, sql string, args ...interface{}) (int, error) + func (c *Core) GetCtx() context.Context + func (c *Core) GetCtxTimeout(ctx context.Context, timeoutType int) (context.Context, context.CancelFunc) + func (c *Core) GetDB() DB + func (c *Core) GetDebug() bool + func (c *Core) GetDryRun() bool + func (c *Core) GetGroup() string + func (c *Core) GetIgnoreResultFromCtx(ctx context.Context) bool + func (c *Core) GetInternalCtxDataFromCtx(ctx context.Context) *internalCtxData + func (c *Core) GetLink(ctx context.Context, master bool, schema string) (Link, error) + func (c *Core) GetLogger() glog.ILogger + func (c *Core) GetOne(ctx context.Context, sql string, args ...interface{}) (Record, error) + func (c *Core) GetPrefix() string + func (c *Core) GetScan(ctx context.Context, pointer interface{}, sql string, args ...interface{}) error + func (c *Core) GetSchema() string + func (c *Core) GetValue(ctx context.Context, sql string, args ...interface{}) (Value, error) + func (c *Core) HasField(ctx context.Context, table, field string, schema ...string) (bool, error) + func (c *Core) HasTable(name string) (bool, error) + func (c *Core) InjectIgnoreResult(ctx context.Context) context.Context + func (c *Core) InjectInternalCtxData(ctx context.Context) context.Context + func (c *Core) Insert(ctx context.Context, table string, data interface{}, batch ...int) (sql.Result, error) + func (c *Core) InsertAndGetId(ctx context.Context, table string, data interface{}, batch ...int) (int64, error) + func (c *Core) InsertIgnore(ctx context.Context, table string, data interface{}, batch ...int) (sql.Result, error) + func (c *Core) Master(schema ...string) (*sql.DB, error) + func (c *Core) MasterLink(schema ...string) (Link, error) + func (c *Core) Model(tableNameQueryOrStruct ...interface{}) *Model + func (c *Core) PingMaster() error + func (c *Core) PingSlave() error + func (c *Core) Prepare(ctx context.Context, sql string, execOnMaster ...bool) (*Stmt, error) + func (c *Core) Query(ctx context.Context, sql string, args ...interface{}) (result Result, err error) + func (c *Core) QuotePrefixTableName(table string) string + func (c *Core) QuoteString(s string) string + func (c *Core) QuoteWord(s string) string + func (c *Core) Raw(rawSql string, args ...interface{}) *Model + func (c *Core) Replace(ctx context.Context, table string, data interface{}, batch ...int) (sql.Result, error) + func (c *Core) RowsToResult(ctx context.Context, rows *sql.Rows) (Result, error) + func (c *Core) Save(ctx context.Context, table string, data interface{}, batch ...int) (sql.Result, error) + func (c *Core) Schema(schema string) *Schema + func (c *Core) SetDebug(debug bool) + func (c *Core) SetDryRun(enabled bool) + func (c *Core) SetLogger(logger glog.ILogger) + func (c *Core) SetMaxConnLifeTime(d time.Duration) + func (c *Core) SetMaxIdleConnCount(n int) + func (c *Core) SetMaxOpenConnCount(n int) + func (c *Core) Slave(schema ...string) (*sql.DB, error) + func (c *Core) SlaveLink(schema ...string) (Link, error) + func (c *Core) TableFields(ctx context.Context, table string, schema ...string) (fields map[string]*TableField, err error) + func (c *Core) Tables(ctx context.Context, schema ...string) (tables []string, err error) + func (c *Core) Transaction(ctx context.Context, f func(ctx context.Context, tx TX) error) (err error) + func (c *Core) Union(unions ...*Model) *Model + func (c *Core) UnionAll(unions ...*Model) *Model + func (c *Core) Update(ctx context.Context, table string, data interface{}, condition interface{}, ...) (sql.Result, error) + func (c *Core) With(objects ...interface{}) *Model + func (c Core) MarshalJSON() ([]byte, error) + type Counter struct + Field string + Value float64 + type DB interface + Begin func(ctx context.Context) (TX, error) + CheckLocalTypeForField func(ctx context.Context, fieldType string, fieldValue interface{}) (string, error) + Close func(ctx context.Context) error + ConvertDataForRecord func(ctx context.Context, data interface{}) (map[string]interface{}, error) + ConvertValueForLocal func(ctx context.Context, fieldType string, fieldValue interface{}) (interface{}, error) + Ctx func(ctx context.Context) DB + Delete func(ctx context.Context, table string, condition interface{}, args ...interface{}) (sql.Result, error) + DoCommit func(ctx context.Context, in DoCommitInput) (out DoCommitOutput, err error) + DoDelete func(ctx context.Context, link Link, table string, condition string, ...) (result sql.Result, err error) + DoExec func(ctx context.Context, link Link, sql string, args ...interface{}) (result sql.Result, err error) + DoFilter func(ctx context.Context, link Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error) + DoInsert func(ctx context.Context, link Link, table string, data List, option DoInsertOption) (result sql.Result, err error) + DoPrepare func(ctx context.Context, link Link, sql string) (*Stmt, error) + DoQuery func(ctx context.Context, link Link, sql string, args ...interface{}) (result Result, err error) + DoSelect func(ctx context.Context, link Link, sql string, args ...interface{}) (result Result, err error) + DoUpdate func(ctx context.Context, link Link, table string, data interface{}, ...) (result sql.Result, err error) + Exec func(ctx context.Context, sql string, args ...interface{}) (sql.Result, error) + GetAll func(ctx context.Context, sql string, args ...interface{}) (Result, error) + GetArray func(ctx context.Context, sql string, args ...interface{}) ([]Value, error) + GetCache func() *gcache.Cache + GetChars func() (charLeft string, charRight string) + GetConfig func() *ConfigNode + GetCore func() *Core + GetCount func(ctx context.Context, sql string, args ...interface{}) (int, error) + GetCtx func() context.Context + GetDebug func() bool + GetDryRun func() bool + GetGroup func() string + GetLogger func() glog.ILogger + GetOne func(ctx context.Context, sql string, args ...interface{}) (Record, error) + GetPrefix func() string + GetScan func(ctx context.Context, objPointer interface{}, sql string, args ...interface{}) error + GetSchema func() string + GetValue func(ctx context.Context, sql string, args ...interface{}) (Value, error) + Insert func(ctx context.Context, table string, data interface{}, batch ...int) (sql.Result, error) + InsertAndGetId func(ctx context.Context, table string, data interface{}, batch ...int) (int64, error) + InsertIgnore func(ctx context.Context, table string, data interface{}, batch ...int) (sql.Result, error) + Master func(schema ...string) (*sql.DB, error) + Model func(tableNameOrStruct ...interface{}) *Model + Open func(config *ConfigNode) (*sql.DB, error) + PingMaster func() error + PingSlave func() error + Prepare func(ctx context.Context, sql string, execOnMaster ...bool) (*Stmt, error) + Query func(ctx context.Context, sql string, args ...interface{}) (Result, error) + Raw func(rawSql string, args ...interface{}) *Model + Replace func(ctx context.Context, table string, data interface{}, batch ...int) (sql.Result, error) + Save func(ctx context.Context, table string, data interface{}, batch ...int) (sql.Result, error) + Schema func(schema string) *Schema + SetDebug func(debug bool) + SetDryRun func(enabled bool) + SetLogger func(logger glog.ILogger) + SetMaxConnLifeTime func(d time.Duration) + SetMaxIdleConnCount func(n int) + SetMaxOpenConnCount func(n int) + Slave func(schema ...string) (*sql.DB, error) + TableFields func(ctx context.Context, table string, schema ...string) (map[string]*TableField, error) + Tables func(ctx context.Context, schema ...string) (tables []string, err error) + Transaction func(ctx context.Context, f func(ctx context.Context, tx TX) error) error + Union func(unions ...*Model) *Model + UnionAll func(unions ...*Model) *Model + Update func(ctx context.Context, table string, data interface{}, condition interface{}, ...) (sql.Result, error) + With func(objects ...interface{}) *Model + func DBFromCtx(ctx context.Context) DB + func Instance(name ...string) (db DB, err error) + func New(node ConfigNode) (db DB, err error) + func NewByGroup(group ...string) (db DB, err error) + type DoCommitInput struct + Args []interface{} + Db *sql.DB + IsTransaction bool + Link Link + Sql string + Stmt *sql.Stmt + Tx *sql.Tx + Type string + type DoCommitOutput struct + RawResult interface{} + Records []Record + Result sql.Result + Stmt *Stmt + Tx TX + type DoInsertOption struct + BatchCount int + InsertOption int + OnDuplicateMap map[string]interface{} + OnDuplicateStr string + type Driver interface + New func(core *Core, node *ConfigNode) (DB, error) + type DriverDefault struct + func (d *DriverDefault) New(core *Core, node *ConfigNode) (DB, error) + func (d *DriverDefault) Open(config *ConfigNode) (db *sql.DB, err error) + func (d *DriverDefault) PingMaster() error + func (d *DriverDefault) PingSlave() error + type DriverWrapper struct + func (d *DriverWrapper) New(core *Core, node *ConfigNode) (DB, error) + type DriverWrapperDB struct + func (d *DriverWrapperDB) Open(node *ConfigNode) (db *sql.DB, err error) + func (d *DriverWrapperDB) TableFields(ctx context.Context, table string, schema ...string) (fields map[string]*TableField, err error) + func (d *DriverWrapperDB) Tables(ctx context.Context, schema ...string) (tables []string, err error) + type HookDeleteInput struct + Args []interface{} + Condition string + Model *Model + Table string + func (h *HookDeleteInput) Next(ctx context.Context) (result sql.Result, err error) + type HookFuncDelete func(ctx context.Context, in *HookDeleteInput) (result sql.Result, err error) + type HookFuncInsert func(ctx context.Context, in *HookInsertInput) (result sql.Result, err error) + type HookFuncSelect func(ctx context.Context, in *HookSelectInput) (result Result, err error) + type HookFuncUpdate func(ctx context.Context, in *HookUpdateInput) (result sql.Result, err error) + type HookHandler struct + Delete HookFuncDelete + Insert HookFuncInsert + Select HookFuncSelect + Update HookFuncUpdate + type HookInsertInput struct + Data List + Model *Model + Option DoInsertOption + Table string + func (h *HookInsertInput) Next(ctx context.Context) (result sql.Result, err error) + type HookSelectInput struct + Args []interface{} + Model *Model + Sql string + Table string + func (h *HookSelectInput) Next(ctx context.Context) (result Result, err error) + type HookUpdateInput struct + Args []interface{} + Condition string + Data interface{} + Model *Model + Table string + func (h *HookUpdateInput) Next(ctx context.Context) (result sql.Result, err error) + type Link interface + ExecContext func(ctx context.Context, sql string, args ...interface{}) (sql.Result, error) + IsOnMaster func() bool + IsTransaction func() bool + PrepareContext func(ctx context.Context, sql string) (*sql.Stmt, error) + QueryContext func(ctx context.Context, sql string, args ...interface{}) (*sql.Rows, error) + type List = []Map + type Map = map[string]interface + type Model struct + func (m *Model) All(where ...interface{}) (Result, error) + func (m *Model) Args(args ...interface{}) *Model + func (m *Model) Array(fieldsAndWhere ...interface{}) ([]Value, error) + func (m *Model) As(as string) *Model + func (m *Model) Avg(column string) (float64, error) + func (m *Model) Batch(batch int) *Model + func (m *Model) Builder() *WhereBuilder + func (m *Model) Cache(option CacheOption) *Model + func (m *Model) Chunk(size int, handler ChunkHandler) + func (m *Model) Clone() *Model + func (m *Model) Count(where ...interface{}) (int, error) + func (m *Model) CountColumn(column string) (int, error) + func (m *Model) Ctx(ctx context.Context) *Model + func (m *Model) DB(db DB) *Model + func (m *Model) Data(data ...interface{}) *Model + func (m *Model) Decrement(column string, amount interface{}) (sql.Result, error) + func (m *Model) Delete(where ...interface{}) (result sql.Result, err error) + func (m *Model) Distinct() *Model + func (m *Model) FieldAvg(column string, as ...string) *Model + func (m *Model) FieldCount(column string, as ...string) *Model + func (m *Model) FieldMax(column string, as ...string) *Model + func (m *Model) FieldMin(column string, as ...string) *Model + func (m *Model) FieldSum(column string, as ...string) *Model + func (m *Model) Fields(fieldNamesOrMapStruct ...interface{}) *Model + func (m *Model) FieldsEx(fieldNamesOrMapStruct ...interface{}) *Model + func (m *Model) FieldsExPrefix(prefix string, fieldNamesOrMapStruct ...interface{}) *Model + func (m *Model) FieldsPrefix(prefix string, fieldNamesOrMapStruct ...interface{}) *Model + func (m *Model) GetCtx() context.Context + func (m *Model) GetFieldsExStr(fields string, prefix ...string) string + func (m *Model) GetFieldsStr(prefix ...string) string + func (m *Model) Group(groupBy ...string) *Model + func (m *Model) Handler(handlers ...ModelHandler) *Model + func (m *Model) HasField(field string) (bool, error) + func (m *Model) Having(having interface{}, args ...interface{}) *Model + func (m *Model) Hook(hook HookHandler) *Model + func (m *Model) Increment(column string, amount interface{}) (sql.Result, error) + func (m *Model) InnerJoin(table ...string) *Model + func (m *Model) InnerJoinOnField(table, field string) *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) LeftJoin(table ...string) *Model + func (m *Model) LeftJoinOnField(table, field string) *Model + func (m *Model) Limit(limit ...int) *Model + func (m *Model) LockShared() *Model + func (m *Model) LockUpdate() *Model + func (m *Model) Master() *Model + func (m *Model) Max(column string) (float64, error) + func (m *Model) Min(column string) (float64, error) + func (m *Model) Offset(offset int) *Model + func (m *Model) OmitEmpty() *Model + func (m *Model) OmitEmptyData() *Model + func (m *Model) OmitEmptyWhere() *Model + func (m *Model) OmitNil() *Model + func (m *Model) OmitNilData() *Model + func (m *Model) OmitNilWhere() *Model + func (m *Model) OnDuplicate(onDuplicate ...interface{}) *Model + func (m *Model) OnDuplicateEx(onDuplicateEx ...interface{}) *Model + func (m *Model) One(where ...interface{}) (Record, error) + func (m *Model) Order(orderBy ...interface{}) *Model + func (m *Model) OrderAsc(column string) *Model + func (m *Model) OrderDesc(column string) *Model + func (m *Model) OrderRandom() *Model + func (m *Model) Page(page, limit int) *Model + func (m *Model) QuoteWord(s string) string + func (m *Model) Raw(rawSql string, args ...interface{}) *Model + func (m *Model) Replace(data ...interface{}) (result sql.Result, err error) + func (m *Model) RightJoin(table ...string) *Model + func (m *Model) RightJoinOnField(table, field string) *Model + func (m *Model) Safe(safe ...bool) *Model + func (m *Model) Save(data ...interface{}) (result sql.Result, err error) + func (m *Model) Scan(pointer interface{}, where ...interface{}) error + func (m *Model) ScanList(structSlicePointer interface{}, bindToAttrName string, ...) (err error) + func (m *Model) Schema(schema string) *Model + func (m *Model) Slave() *Model + func (m *Model) Sum(column string) (float64, error) + func (m *Model) TX(tx TX) *Model + func (m *Model) TableFields(tableStr string, schema ...string) (fields map[string]*TableField, err error) + func (m *Model) Transaction(ctx context.Context, f func(ctx context.Context, tx TX) error) (err error) + func (m *Model) Union(unions ...*Model) *Model + func (m *Model) UnionAll(unions ...*Model) *Model + func (m *Model) Unscoped() *Model + func (m *Model) Update(dataAndWhere ...interface{}) (result sql.Result, err error) + func (m *Model) UpdateAndGetAffected(dataAndWhere ...interface{}) (affected int64, err error) + func (m *Model) Value(fieldsAndWhere ...interface{}) (Value, error) + func (m *Model) Where(where interface{}, args ...interface{}) *Model + func (m *Model) WhereBetween(column string, min, max interface{}) *Model + func (m *Model) WhereGT(column string, value interface{}) *Model + func (m *Model) WhereGTE(column string, value interface{}) *Model + func (m *Model) WhereIn(column string, in interface{}) *Model + func (m *Model) WhereLT(column string, value interface{}) *Model + func (m *Model) WhereLTE(column string, value interface{}) *Model + func (m *Model) WhereLike(column string, like string) *Model + func (m *Model) WhereNot(column string, value interface{}) *Model + func (m *Model) WhereNotBetween(column string, min, max interface{}) *Model + func (m *Model) WhereNotIn(column string, in interface{}) *Model + func (m *Model) WhereNotLike(column string, like interface{}) *Model + func (m *Model) WhereNotNull(columns ...string) *Model + func (m *Model) WhereNull(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) WhereOrGT(column string, value interface{}) *Model + func (m *Model) WhereOrGTE(column string, value interface{}) *Model + func (m *Model) WhereOrIn(column string, in interface{}) *Model + func (m *Model) WhereOrLT(column string, value interface{}) *Model + func (m *Model) WhereOrLTE(column string, value interface{}) *Model + func (m *Model) WhereOrLike(column string, like interface{}) *Model + func (m *Model) WhereOrNot(column string, value interface{}) *Model + func (m *Model) WhereOrNotBetween(column string, min, max interface{}) *Model + func (m *Model) WhereOrNotIn(column string, in interface{}) *Model + func (m *Model) WhereOrNotLike(column string, like interface{}) *Model + func (m *Model) WhereOrNotNull(columns ...string) *Model + func (m *Model) WhereOrNull(columns ...string) *Model + func (m *Model) WhereOrPrefix(prefix string, where interface{}, args ...interface{}) *Model + func (m *Model) WhereOrPrefixBetween(prefix string, column string, min, max interface{}) *Model + func (m *Model) WhereOrPrefixGT(prefix string, column string, value interface{}) *Model + func (m *Model) WhereOrPrefixGTE(prefix string, column string, value interface{}) *Model + func (m *Model) WhereOrPrefixIn(prefix string, column string, in interface{}) *Model + func (m *Model) WhereOrPrefixLT(prefix string, column string, value interface{}) *Model + func (m *Model) WhereOrPrefixLTE(prefix string, column string, value interface{}) *Model + func (m *Model) WhereOrPrefixLike(prefix string, column string, like interface{}) *Model + func (m *Model) WhereOrPrefixNot(prefix string, column string, value interface{}) *Model + func (m *Model) WhereOrPrefixNotBetween(prefix string, column string, min, max interface{}) *Model + func (m *Model) WhereOrPrefixNotIn(prefix string, column string, in interface{}) *Model + func (m *Model) WhereOrPrefixNotLike(prefix string, column string, like interface{}) *Model + func (m *Model) WhereOrPrefixNotNull(prefix string, columns ...string) *Model + func (m *Model) WhereOrPrefixNull(prefix string, columns ...string) *Model + func (m *Model) WhereOrf(format string, args ...interface{}) *Model + func (m *Model) WherePrefix(prefix string, where interface{}, args ...interface{}) *Model + func (m *Model) WherePrefixBetween(prefix string, column string, min, max interface{}) *Model + func (m *Model) WherePrefixGT(prefix string, column string, value interface{}) *Model + func (m *Model) WherePrefixGTE(prefix string, column string, value interface{}) *Model + func (m *Model) WherePrefixIn(prefix string, column string, in interface{}) *Model + func (m *Model) WherePrefixLT(prefix string, column string, value interface{}) *Model + func (m *Model) WherePrefixLTE(prefix string, column string, value interface{}) *Model + func (m *Model) WherePrefixLike(prefix string, column string, like interface{}) *Model + func (m *Model) WherePrefixNot(prefix string, column string, value interface{}) *Model + func (m *Model) WherePrefixNotBetween(prefix string, column string, min, max interface{}) *Model + func (m *Model) WherePrefixNotIn(prefix string, column string, in interface{}) *Model + func (m *Model) WherePrefixNotLike(prefix string, column string, like interface{}) *Model + func (m *Model) WherePrefixNotNull(prefix string, columns ...string) *Model + func (m *Model) WherePrefixNull(prefix string, columns ...string) *Model + func (m *Model) WherePri(where interface{}, args ...interface{}) *Model + func (m *Model) Wheref(format string, args ...interface{}) *Model + func (m *Model) With(objects ...interface{}) *Model + func (m *Model) WithAll() *Model + type ModelHandler func(m *Model) *Model + type Raw string + type Record map[string]Value + func (r Record) GMap() *gmap.StrAnyMap + func (r Record) IsEmpty() bool + func (r Record) Json() string + func (r Record) Map() Map + func (r Record) Struct(pointer interface{}) error + func (r Record) Xml(rootTag ...string) string + type Result []Record + func (r Result) Array(field ...string) []Value + func (r Result) Chunk(size int) []Result + func (r Result) IsEmpty() bool + func (r Result) Json() string + func (r Result) Len() int + func (r Result) List() List + func (r Result) MapKeyInt(key string) map[int]Map + func (r Result) MapKeyStr(key string) map[string]Map + func (r Result) MapKeyUint(key string) map[uint]Map + func (r Result) MapKeyValue(key string) map[string]Value + func (r Result) RecordKeyInt(key string) map[int]Record + func (r Result) RecordKeyStr(key string) map[string]Record + func (r Result) RecordKeyUint(key string) map[uint]Record + func (r Result) ScanList(structSlicePointer interface{}, bindToAttrName string, ...) (err error) + func (r Result) Size() int + func (r Result) Structs(pointer interface{}) (err error) + func (r Result) Xml(rootTag ...string) string + type Schema struct + type Sql struct + Args []interface{} + End int64 + Error error + Format string + Group string + IsTransaction bool + RowsAffected int64 + Schema string + Sql string + Start int64 + Type string + type SqlResult struct + Affected int64 + Result sql.Result + func (r *SqlResult) LastInsertId() (int64, error) + func (r *SqlResult) MustGetAffected() int64 + func (r *SqlResult) MustGetInsertId() int64 + func (r *SqlResult) RowsAffected() (int64, error) + type Stmt struct + func (s *Stmt) Close() error + func (s *Stmt) Exec(args ...interface{}) (sql.Result, error) + func (s *Stmt) ExecContext(ctx context.Context, args ...interface{}) (sql.Result, error) + func (s *Stmt) Query(args ...interface{}) (*sql.Rows, error) + func (s *Stmt) QueryContext(ctx context.Context, args ...interface{}) (*sql.Rows, error) + func (s *Stmt) QueryRow(args ...interface{}) *sql.Row + func (s *Stmt) QueryRowContext(ctx context.Context, args ...interface{}) *sql.Row + type TX interface + Begin func() error + Commit func() error + Ctx func(ctx context.Context) TX + Delete func(table string, condition interface{}, args ...interface{}) (sql.Result, error) + Exec func(sql string, args ...interface{}) (sql.Result, error) + GetAll func(sql string, args ...interface{}) (Result, error) + GetCount func(sql string, args ...interface{}) (int64, error) + GetCtx func() context.Context + GetDB func() DB + GetOne func(sql string, args ...interface{}) (Record, error) + GetScan func(pointer interface{}, sql string, args ...interface{}) error + GetSqlTX func() *sql.Tx + GetStruct func(obj interface{}, sql string, args ...interface{}) error + GetStructs func(objPointerSlice interface{}, sql string, args ...interface{}) error + GetValue func(sql string, args ...interface{}) (Value, error) + Insert func(table string, data interface{}, batch ...int) (sql.Result, error) + InsertAndGetId func(table string, data interface{}, batch ...int) (int64, error) + InsertIgnore func(table string, data interface{}, batch ...int) (sql.Result, error) + IsClosed func() bool + Model func(tableNameQueryOrStruct ...interface{}) *Model + Prepare func(sql string) (*Stmt, error) + Query func(sql string, args ...interface{}) (result Result, err error) + Raw func(rawSql string, args ...interface{}) *Model + Replace func(table string, data interface{}, batch ...int) (sql.Result, error) + Rollback func() error + RollbackTo func(point string) error + Save func(table string, data interface{}, batch ...int) (sql.Result, error) + SavePoint func(point string) error + Transaction func(ctx context.Context, f func(ctx context.Context, tx TX) error) (err error) + Update func(table string, data interface{}, condition interface{}, args ...interface{}) (sql.Result, error) + With func(object interface{}) *Model + func TXFromCtx(ctx context.Context, group string) TX + type TXCore struct + func (tx *TXCore) Begin() error + func (tx *TXCore) Commit() error + func (tx *TXCore) Ctx(ctx context.Context) TX + func (tx *TXCore) Delete(table string, condition interface{}, args ...interface{}) (sql.Result, error) + func (tx *TXCore) Exec(sql string, args ...interface{}) (sql.Result, error) + func (tx *TXCore) GetAll(sql string, args ...interface{}) (Result, error) + func (tx *TXCore) GetCount(sql string, args ...interface{}) (int64, error) + func (tx *TXCore) GetCtx() context.Context + func (tx *TXCore) GetDB() DB + func (tx *TXCore) GetOne(sql string, args ...interface{}) (Record, error) + func (tx *TXCore) GetScan(pointer interface{}, sql string, args ...interface{}) error + func (tx *TXCore) GetSqlTX() *sql.Tx + func (tx *TXCore) GetStruct(obj interface{}, sql string, args ...interface{}) error + func (tx *TXCore) GetStructs(objPointerSlice interface{}, sql string, args ...interface{}) error + func (tx *TXCore) GetValue(sql string, args ...interface{}) (Value, error) + func (tx *TXCore) Insert(table string, data interface{}, batch ...int) (sql.Result, error) + func (tx *TXCore) InsertAndGetId(table string, data interface{}, batch ...int) (int64, error) + func (tx *TXCore) InsertIgnore(table string, data interface{}, batch ...int) (sql.Result, error) + func (tx *TXCore) IsClosed() bool + func (tx *TXCore) Model(tableNameQueryOrStruct ...interface{}) *Model + func (tx *TXCore) Prepare(sql string) (*Stmt, error) + func (tx *TXCore) Query(sql string, args ...interface{}) (result Result, err error) + func (tx *TXCore) Raw(rawSql string, args ...interface{}) *Model + func (tx *TXCore) Replace(table string, data interface{}, batch ...int) (sql.Result, error) + func (tx *TXCore) Rollback() error + func (tx *TXCore) RollbackTo(point string) error + func (tx *TXCore) Save(table string, data interface{}, batch ...int) (sql.Result, error) + func (tx *TXCore) SavePoint(point string) error + func (tx *TXCore) Transaction(ctx context.Context, f func(ctx context.Context, tx TX) error) (err error) + func (tx *TXCore) Update(table string, data interface{}, condition interface{}, args ...interface{}) (sql.Result, error) + func (tx *TXCore) With(object interface{}) *Model + type TableField struct + Comment string + Default interface{} + Extra string + Index int + Key string + Name string + Null bool + Type string + type Value = *gvar.Var + type WhereBuilder struct + func (b *WhereBuilder) Build() (conditionWhere string, conditionArgs []interface{}) + func (b *WhereBuilder) Clone() *WhereBuilder + func (b *WhereBuilder) Where(where interface{}, args ...interface{}) *WhereBuilder + func (b *WhereBuilder) WhereBetween(column string, min, max interface{}) *WhereBuilder + func (b *WhereBuilder) WhereGT(column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereGTE(column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereIn(column string, in interface{}) *WhereBuilder + func (b *WhereBuilder) WhereLT(column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereLTE(column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereLike(column string, like string) *WhereBuilder + func (b *WhereBuilder) WhereNot(column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereNotBetween(column string, min, max interface{}) *WhereBuilder + func (b *WhereBuilder) WhereNotIn(column string, in interface{}) *WhereBuilder + func (b *WhereBuilder) WhereNotLike(column string, like interface{}) *WhereBuilder + func (b *WhereBuilder) WhereNotNull(columns ...string) *WhereBuilder + func (b *WhereBuilder) WhereNull(columns ...string) *WhereBuilder + func (b *WhereBuilder) WhereOr(where interface{}, args ...interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrBetween(column string, min, max interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrGT(column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrGTE(column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrIn(column string, in interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrLT(column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrLTE(column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrLike(column string, like interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrNot(column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrNotBetween(column string, min, max interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrNotIn(column string, in interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrNotLike(column string, like interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrNotNull(columns ...string) *WhereBuilder + func (b *WhereBuilder) WhereOrNull(columns ...string) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefix(prefix string, where interface{}, args ...interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefixBetween(prefix string, column string, min, max interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefixGT(prefix string, column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefixGTE(prefix string, column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefixIn(prefix string, column string, in interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefixLT(prefix string, column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefixLTE(prefix string, column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefixLike(prefix string, column string, like interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefixNot(prefix string, column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefixNotBetween(prefix string, column string, min, max interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefixNotIn(prefix string, column string, in interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefixNotLike(prefix string, column string, like interface{}) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefixNotNull(prefix string, columns ...string) *WhereBuilder + func (b *WhereBuilder) WhereOrPrefixNull(prefix string, columns ...string) *WhereBuilder + func (b *WhereBuilder) WhereOrf(format string, args ...interface{}) *WhereBuilder + func (b *WhereBuilder) WherePrefix(prefix string, where interface{}, args ...interface{}) *WhereBuilder + func (b *WhereBuilder) WherePrefixBetween(prefix string, column string, min, max interface{}) *WhereBuilder + func (b *WhereBuilder) WherePrefixGT(prefix string, column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WherePrefixGTE(prefix string, column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WherePrefixIn(prefix string, column string, in interface{}) *WhereBuilder + func (b *WhereBuilder) WherePrefixLT(prefix string, column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WherePrefixLTE(prefix string, column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WherePrefixLike(prefix string, column string, like interface{}) *WhereBuilder + func (b *WhereBuilder) WherePrefixNot(prefix string, column string, value interface{}) *WhereBuilder + func (b *WhereBuilder) WherePrefixNotBetween(prefix string, column string, min, max interface{}) *WhereBuilder + func (b *WhereBuilder) WherePrefixNotIn(prefix string, column string, in interface{}) *WhereBuilder + func (b *WhereBuilder) WherePrefixNotLike(prefix string, column string, like interface{}) *WhereBuilder + func (b *WhereBuilder) WherePrefixNotNull(prefix string, columns ...string) *WhereBuilder + func (b *WhereBuilder) WherePrefixNull(prefix string, columns ...string) *WhereBuilder + func (b *WhereBuilder) WherePri(where interface{}, args ...interface{}) *WhereBuilder + func (b *WhereBuilder) Wheref(format string, args ...interface{}) *WhereBuilder + type WhereHolder struct + Args []interface{} + Operator int + Prefix string + Type string + Where interface{} Other modules containing this package github.com/joy12825/gf