Versions in this module Expand all Collapse all v1 v1.17.0 Sep 16, 2022 Changes in this version + const DefaultGroupName + const OrmTagForPrimary + const OrmTagForStruct + const OrmTagForTable + const OrmTagForUnique + const OrmTagForWith + const OrmTagForWithOrder + const OrmTagForWithWhere + func AddConfigNode(group string, node ConfigNode) + func AddDefaultConfigGroup(nodes ConfigGroup) + func AddDefaultConfigNode(node ConfigNode) + func ConvertDataForTableRecord(value interface{}) map[string]interface + func DataToMapDeep(value interface{}) map[string]interface + func FormatSqlWithArgs(sql string, args []interface{}) string + func GetDefaultGroup() string + func GetInsertOperationByOption(option int) string + func GetPrimaryKey(pointer interface{}) (string, error) + func GetPrimaryKeyCondition(primary string, where ...interface{}) (newWhereCondition []interface{}) + func GetWhereConditionOfStruct(pointer interface{}) (where string, args []interface{}, err error) + 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 WithTX(ctx context.Context, tx *TX) context.Context + 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 + CtxStrict bool + Debug bool + DeletedAt string + DryRun bool + ExecTimeout time.Duration + Host string + Link string + MaxConnLifeTime time.Duration + MaxIdleConnCount int + MaxOpenConnCount int + Name string + Pass string + Port string + Prefix string + PrepareTimeout time.Duration + QueryTimeout time.Duration + Role string + TimeMaintainDisabled bool + Timezone string + TranTimeout time.Duration + Type string + UpdatedAt string + User string + Weight int + func (node *ConfigNode) String() string + type Core struct + func (c *Core) Begin() (tx *TX, err error) + func (c *Core) Close(ctx context.Context) (err error) + func (c *Core) Ctx(ctx context.Context) DB + func (c *Core) Delete(table string, condition interface{}, args ...interface{}) (result sql.Result, err error) + func (c *Core) DoCommit(ctx context.Context, link Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, 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) DoGetAll(ctx context.Context, link Link, sql string, args ...interface{}) (result Result, 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, error) + func (c *Core) DoQuery(ctx context.Context, link Link, sql string, args ...interface{}) (rows *sql.Rows, err error) + func (c *Core) DoUpdate(ctx context.Context, link Link, table string, data interface{}, ...) (result sql.Result, err error) + func (c *Core) Exec(sql string, args ...interface{}) (result sql.Result, err error) + func (c *Core) GetAll(sql string, args ...interface{}) (Result, error) + func (c *Core) GetArray(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(sql string, args ...interface{}) (int, error) + func (c *Core) GetCtx() context.Context + func (c *Core) GetCtxTimeout(timeoutType int, ctx context.Context) (context.Context, context.CancelFunc) + func (c *Core) GetDebug() bool + func (c *Core) GetDryRun() bool + func (c *Core) GetGroup() string + func (c *Core) GetLogger() *glog.Logger + func (c *Core) GetOne(sql string, args ...interface{}) (Record, error) + func (c *Core) GetPrefix() string + func (c *Core) GetScan(pointer interface{}, sql string, args ...interface{}) error + func (c *Core) GetSchema() string + func (c *Core) GetStruct(pointer interface{}, sql string, args ...interface{}) error + func (c *Core) GetStructs(pointer interface{}, sql string, args ...interface{}) error + func (c *Core) GetValue(sql string, args ...interface{}) (Value, error) + func (c *Core) HasTable(name string) (bool, error) + func (c *Core) Insert(table string, data interface{}, batch ...int) (sql.Result, error) + func (c *Core) InsertAndGetId(table string, data interface{}, batch ...int) (int64, error) + func (c *Core) InsertIgnore(table string, data interface{}, batch ...int) (sql.Result, error) + func (c *Core) MarshalJSON() ([]byte, 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(sql string, execOnMaster ...bool) (*Stmt, error) + func (c *Core) Query(sql string, args ...interface{}) (rows *sql.Rows, 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(table string, data interface{}, batch ...int) (sql.Result, error) + func (c *Core) Save(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.Logger) + func (c *Core) SetMaxConnLifeTime(d time.Duration) + func (c *Core) SetMaxIdleConnCount(n int) + func (c *Core) SetMaxOpenConnCount(n int) + func (c *Core) SetSchema(schema string) + func (c *Core) Slave(schema ...string) (*sql.DB, error) + func (c *Core) SlaveLink(schema ...string) (Link, error) + func (c *Core) Table(tableNameQueryOrStruct ...interface{}) *Model + func (c *Core) TableFields(table string, schema ...string) (fields map[string]*TableField, err error) + func (c *Core) Tables(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(table string, data interface{}, condition interface{}, args ...interface{}) (sql.Result, error) + func (c *Core) With(objects ...interface{}) *Model + type Counter struct + Field string + Value float64 + type DB interface + Begin func() (*TX, error) + Close func(ctx context.Context) error + Ctx func(ctx context.Context) DB + Delete func(table string, condition interface{}, args ...interface{}) (sql.Result, error) + DoCommit func(ctx context.Context, link Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, 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) + DoGetAll func(ctx context.Context, link Link, sql string, args ...interface{}) (result Result, 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{}) (rows *sql.Rows, err error) + DoUpdate func(ctx context.Context, link Link, table string, data interface{}, ...) (result sql.Result, err error) + Exec func(sql string, args ...interface{}) (sql.Result, error) + FilteredLink func() string + GetAll func(sql string, args ...interface{}) (Result, error) + GetArray func(sql string, args ...interface{}) ([]Value, error) + GetCache func() *gcache.Cache + GetChars func() (charLeft string, charRight string) + GetConfig func() *ConfigNode + GetCore func() *Core + GetCount func(sql string, args ...interface{}) (int, error) + GetCtx func() context.Context + GetDebug func() bool + GetDryRun func() bool + GetGroup func() string + GetLogger func() *glog.Logger + GetOne func(sql string, args ...interface{}) (Record, error) + GetPrefix func() string + GetScan func(objPointer interface{}, sql string, args ...interface{}) error + GetSchema func() string + 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) + 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(sql string, execOnMaster ...bool) (*Stmt, error) + Query func(sql string, args ...interface{}) (*sql.Rows, error) + Raw func(rawSql string, args ...interface{}) *Model + Replace func(table string, data interface{}, batch ...int) (sql.Result, error) + Save func(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.Logger) + SetMaxConnLifeTime func(d time.Duration) + SetMaxIdleConnCount func(n int) + SetMaxOpenConnCount func(n int) + SetSchema func(schema string) + Slave func(schema ...string) (*sql.DB, error) + Table func(tableNameOrStruct ...interface{}) *Model + 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(table string, data interface{}, condition interface{}, args ...interface{}) (sql.Result, error) + With func(objects ...interface{}) *Model + func Instance(name ...string) (db DB, err error) + func New(group ...string) (db DB, err error) + 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 DriverMssql struct + func (d *DriverMssql) DoCommit(ctx context.Context, link Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error) + func (d *DriverMssql) DoInsert(ctx context.Context, link Link, table string, list List, option DoInsertOption) (result sql.Result, err error) + func (d *DriverMssql) FilteredLink() string + func (d *DriverMssql) GetChars() (charLeft string, charRight string) + func (d *DriverMssql) New(core *Core, node *ConfigNode) (DB, error) + func (d *DriverMssql) Open(config *ConfigNode) (*sql.DB, error) + func (d *DriverMssql) TableFields(ctx context.Context, table string, schema ...string) (fields map[string]*TableField, err error) + func (d *DriverMssql) Tables(ctx context.Context, schema ...string) (tables []string, err error) + type DriverMysql struct + func (d *DriverMysql) DoCommit(ctx context.Context, link Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error) + func (d *DriverMysql) FilteredLink() string + func (d *DriverMysql) GetChars() (charLeft string, charRight string) + func (d *DriverMysql) New(core *Core, node *ConfigNode) (DB, error) + func (d *DriverMysql) Open(config *ConfigNode) (*sql.DB, error) + func (d *DriverMysql) TableFields(ctx context.Context, table string, schema ...string) (fields map[string]*TableField, err error) + func (d *DriverMysql) Tables(ctx context.Context, schema ...string) (tables []string, err error) + type DriverOracle struct + func (d *DriverOracle) DoCommit(ctx context.Context, link Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error) + func (d *DriverOracle) DoInsert(ctx context.Context, link Link, table string, list List, option DoInsertOption) (result sql.Result, err error) + func (d *DriverOracle) FilteredLink() string + func (d *DriverOracle) GetChars() (charLeft string, charRight string) + func (d *DriverOracle) New(core *Core, node *ConfigNode) (DB, error) + func (d *DriverOracle) Open(config *ConfigNode) (*sql.DB, error) + func (d *DriverOracle) TableFields(ctx context.Context, table string, schema ...string) (fields map[string]*TableField, err error) + func (d *DriverOracle) Tables(ctx context.Context, schema ...string) (tables []string, err error) + type DriverPgsql struct + func (d *DriverPgsql) DoCommit(ctx context.Context, link Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error) + func (d *DriverPgsql) DoInsert(ctx context.Context, link Link, table string, list List, option DoInsertOption) (result sql.Result, err error) + func (d *DriverPgsql) FilteredLink() string + func (d *DriverPgsql) GetChars() (charLeft string, charRight string) + func (d *DriverPgsql) New(core *Core, node *ConfigNode) (DB, error) + func (d *DriverPgsql) Open(config *ConfigNode) (*sql.DB, error) + func (d *DriverPgsql) TableFields(ctx context.Context, table string, schema ...string) (fields map[string]*TableField, err error) + func (d *DriverPgsql) Tables(ctx context.Context, schema ...string) (tables []string, err error) + type DriverSqlite struct + func (d *DriverSqlite) DoCommit(ctx context.Context, link Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error) + func (d *DriverSqlite) DoInsert(ctx context.Context, link Link, table string, list List, option DoInsertOption) (result sql.Result, err error) + func (d *DriverSqlite) FilteredLink() string + func (d *DriverSqlite) GetChars() (charLeft string, charRight string) + func (d *DriverSqlite) New(core *Core, node *ConfigNode) (DB, error) + func (d *DriverSqlite) Open(config *ConfigNode) (*sql.DB, error) + func (d *DriverSqlite) TableFields(ctx context.Context, table string, schema ...string) (fields map[string]*TableField, err error) + func (d *DriverSqlite) Tables(ctx context.Context, schema ...string) (tables []string, err error) + type Link interface + Exec func(sql string, args ...interface{}) (sql.Result, error) + ExecContext func(ctx context.Context, sql string, args ...interface{}) (sql.Result, error) + IsTransaction func() bool + Prepare func(sql string) (*sql.Stmt, error) + PrepareContext func(ctx context.Context, sql string) (*sql.Stmt, error) + Query func(sql string, args ...interface{}) (*sql.Rows, error) + QueryContext func(ctx context.Context, sql string, args ...interface{}) (*sql.Rows, error) + type List = []Map + type Logger interface + Debug func(ctx context.Context, s string) + Error func(ctx context.Context, s string) + type Map = map[string]interface + type Model struct + func (m *Model) All(where ...interface{}) (Result, error) + func (m *Model) And(where interface{}, args ...interface{}) *Model + 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) Cache(duration time.Duration, name ...string) *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) FieldsExStr(fields string, prefix ...string) string + func (m *Model) FieldsStr(prefix ...string) string + func (m *Model) Filter() *Model + func (m *Model) FindAll(where ...interface{}) (Result, error) + func (m *Model) FindArray(fieldsAndWhere ...interface{}) ([]Value, error) + func (m *Model) FindCount(where ...interface{}) (int, error) + func (m *Model) FindOne(where ...interface{}) (Record, error) + func (m *Model) FindScan(pointer interface{}, where ...interface{}) error + func (m *Model) FindValue(fieldsAndWhere ...interface{}) (Value, error) + func (m *Model) ForPage(page, limit int) *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) GroupBy(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) Increment(column string, amount interface{}) (sql.Result, error) + func (m *Model) InnerJoin(table ...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) 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) Option(option int) *Model + func (m *Model) Or(where interface{}, args ...interface{}) *Model + func (m *Model) Order(orderBy ...string) *Model + func (m *Model) OrderAsc(column string) *Model + func (m *Model) OrderBy(orderBy 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) 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) 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(listPointer interface{}, attributeName string, relation ...string) (err error) + func (m *Model) Schema(schema string) *Model + func (m *Model) Select(where ...interface{}) (Result, error) + func (m *Model) Slave() *Model + func (m *Model) Struct(pointer interface{}, where ...interface{}) error + func (m *Model) Structs(pointer interface{}, where ...interface{}) error + 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) 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 interface{}) *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) 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) WhereOrf(format string, args ...interface{}) *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 ModelWhereHolder struct + Args []interface{} + Operator int + Where interface{} + type Raw string + type Record map[string]Value + func (r Record) GMap() *gmap.StrAnyMap + func (r Record) Interface() interface{} + 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) Interface() interface{} + 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(listPointer interface{}, bindToAttrName string, relationKV ...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 + func (s *Schema) Model(table string) *Model + func (s *Schema) Table(table string) *Model + type Sql struct + Args []interface{} + End int64 + Error error + Format string + Group string + IsTransaction bool + Sql string + Start int64 + Type string + type SqlResult struct + 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 struct + func TXFromCtx(ctx context.Context, group string) *TX + func (tx *TX) Begin() error + func (tx *TX) Commit() error + func (tx *TX) Ctx(ctx context.Context) *TX + func (tx *TX) Delete(table string, condition interface{}, args ...interface{}) (sql.Result, error) + func (tx *TX) Exec(sql string, args ...interface{}) (sql.Result, error) + func (tx *TX) GetAll(sql string, args ...interface{}) (Result, error) + func (tx *TX) GetCount(sql string, args ...interface{}) (int, error) + func (tx *TX) GetOne(sql string, args ...interface{}) (Record, error) + func (tx *TX) GetScan(pointer interface{}, sql string, args ...interface{}) error + func (tx *TX) GetStruct(obj interface{}, sql string, args ...interface{}) error + func (tx *TX) GetStructs(objPointerSlice interface{}, sql string, args ...interface{}) error + func (tx *TX) GetValue(sql string, args ...interface{}) (Value, error) + func (tx *TX) Insert(table string, data interface{}, batch ...int) (sql.Result, error) + func (tx *TX) InsertAndGetId(table string, data interface{}, batch ...int) (int64, error) + func (tx *TX) InsertIgnore(table string, data interface{}, batch ...int) (sql.Result, error) + func (tx *TX) IsClosed() bool + func (tx *TX) Model(tableNameQueryOrStruct ...interface{}) *Model + func (tx *TX) Prepare(sql string) (*Stmt, error) + func (tx *TX) Query(sql string, args ...interface{}) (rows *sql.Rows, err error) + func (tx *TX) Raw(rawSql string, args ...interface{}) *Model + func (tx *TX) Replace(table string, data interface{}, batch ...int) (sql.Result, error) + func (tx *TX) Rollback() error + func (tx *TX) RollbackTo(point string) error + func (tx *TX) Save(table string, data interface{}, batch ...int) (sql.Result, error) + func (tx *TX) SavePoint(point string) error + func (tx *TX) Schema(schema string) *Schema + func (tx *TX) Transaction(ctx context.Context, f func(ctx context.Context, tx *TX) error) (err error) + func (tx *TX) Update(table string, data interface{}, condition interface{}, args ...interface{}) (sql.Result, error) + func (tx *TX) 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