Documentation ¶
Index ¶
- Variables
- func SetDefault(db *gorm.DB, opts ...gen.DOOption)
- type IOrderDo
- type IParamDo
- type IRechargeDo
- type IUserDo
- type Query
- func (q *Query) Available() bool
- func (q *Query) Begin(opts ...*sql.TxOptions) *QueryTx
- func (q *Query) ReadDB() *Query
- func (q *Query) ReplaceDB(db *gorm.DB) *Query
- func (q *Query) Transaction(fc func(tx *Query) error, opts ...*sql.TxOptions) error
- func (q *Query) WithContext(ctx context.Context) *queryCtx
- func (q *Query) WriteDB() *Query
- type QueryTx
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Q = new(Query) Order *order Param *param Recharge *recharge User *user )
Functions ¶
Types ¶
type IOrderDo ¶
type IOrderDo interface { gen.SubQuery Debug() IOrderDo WithContext(ctx context.Context) IOrderDo WithResult(fc func(tx gen.Dao)) gen.ResultInfo ReplaceDB(db *gorm.DB) ReadDB() IOrderDo WriteDB() IOrderDo As(alias string) gen.Dao Session(config *gorm.Session) IOrderDo Columns(cols ...field.Expr) gen.Columns Clauses(conds ...clause.Expression) IOrderDo Not(conds ...gen.Condition) IOrderDo Or(conds ...gen.Condition) IOrderDo Select(conds ...field.Expr) IOrderDo Where(conds ...gen.Condition) IOrderDo Order(conds ...field.Expr) IOrderDo Distinct(cols ...field.Expr) IOrderDo Omit(cols ...field.Expr) IOrderDo Join(table schema.Tabler, on ...field.Expr) IOrderDo LeftJoin(table schema.Tabler, on ...field.Expr) IOrderDo RightJoin(table schema.Tabler, on ...field.Expr) IOrderDo Group(cols ...field.Expr) IOrderDo Having(conds ...gen.Condition) IOrderDo Limit(limit int) IOrderDo Offset(offset int) IOrderDo Count() (count int64, err error) Scopes(funcs ...func(gen.Dao) gen.Dao) IOrderDo Unscoped() IOrderDo Create(values ...*model.Order) error CreateInBatches(values []*model.Order, batchSize int) error Save(values ...*model.Order) error First() (*model.Order, error) Take() (*model.Order, error) Last() (*model.Order, error) Find() ([]*model.Order, error) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.Order, err error) FindInBatches(result *[]*model.Order, batchSize int, fc func(tx gen.Dao, batch int) error) error Pluck(column field.Expr, dest interface{}) error Delete(...*model.Order) (info gen.ResultInfo, err error) Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) Updates(value interface{}) (info gen.ResultInfo, err error) UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) UpdateColumns(value interface{}) (info gen.ResultInfo, err error) UpdateFrom(q gen.SubQuery) gen.Dao Attrs(attrs ...field.AssignExpr) IOrderDo Assign(attrs ...field.AssignExpr) IOrderDo Joins(fields ...field.RelationField) IOrderDo Preload(fields ...field.RelationField) IOrderDo FirstOrInit() (*model.Order, error) FirstOrCreate() (*model.Order, error) FindByPage(offset int, limit int) (result []*model.Order, count int64, err error) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) Scan(result interface{}) (err error) Returning(value interface{}, columns ...string) IOrderDo UnderlyingDB() *gorm.DB schema.Tabler }
type IParamDo ¶
type IParamDo interface { gen.SubQuery Debug() IParamDo WithContext(ctx context.Context) IParamDo WithResult(fc func(tx gen.Dao)) gen.ResultInfo ReplaceDB(db *gorm.DB) ReadDB() IParamDo WriteDB() IParamDo As(alias string) gen.Dao Session(config *gorm.Session) IParamDo Columns(cols ...field.Expr) gen.Columns Clauses(conds ...clause.Expression) IParamDo Not(conds ...gen.Condition) IParamDo Or(conds ...gen.Condition) IParamDo Select(conds ...field.Expr) IParamDo Where(conds ...gen.Condition) IParamDo Order(conds ...field.Expr) IParamDo Distinct(cols ...field.Expr) IParamDo Omit(cols ...field.Expr) IParamDo Join(table schema.Tabler, on ...field.Expr) IParamDo LeftJoin(table schema.Tabler, on ...field.Expr) IParamDo RightJoin(table schema.Tabler, on ...field.Expr) IParamDo Group(cols ...field.Expr) IParamDo Having(conds ...gen.Condition) IParamDo Limit(limit int) IParamDo Offset(offset int) IParamDo Count() (count int64, err error) Scopes(funcs ...func(gen.Dao) gen.Dao) IParamDo Unscoped() IParamDo Create(values ...*model.Param) error CreateInBatches(values []*model.Param, batchSize int) error Save(values ...*model.Param) error First() (*model.Param, error) Take() (*model.Param, error) Last() (*model.Param, error) Find() ([]*model.Param, error) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.Param, err error) FindInBatches(result *[]*model.Param, batchSize int, fc func(tx gen.Dao, batch int) error) error Pluck(column field.Expr, dest interface{}) error Delete(...*model.Param) (info gen.ResultInfo, err error) Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) Updates(value interface{}) (info gen.ResultInfo, err error) UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) UpdateColumns(value interface{}) (info gen.ResultInfo, err error) UpdateFrom(q gen.SubQuery) gen.Dao Attrs(attrs ...field.AssignExpr) IParamDo Assign(attrs ...field.AssignExpr) IParamDo Joins(fields ...field.RelationField) IParamDo Preload(fields ...field.RelationField) IParamDo FirstOrInit() (*model.Param, error) FirstOrCreate() (*model.Param, error) FindByPage(offset int, limit int) (result []*model.Param, count int64, err error) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) Scan(result interface{}) (err error) Returning(value interface{}, columns ...string) IParamDo UnderlyingDB() *gorm.DB schema.Tabler }
type IRechargeDo ¶
type IRechargeDo interface { gen.SubQuery Debug() IRechargeDo WithContext(ctx context.Context) IRechargeDo WithResult(fc func(tx gen.Dao)) gen.ResultInfo ReplaceDB(db *gorm.DB) ReadDB() IRechargeDo WriteDB() IRechargeDo As(alias string) gen.Dao Session(config *gorm.Session) IRechargeDo Columns(cols ...field.Expr) gen.Columns Clauses(conds ...clause.Expression) IRechargeDo Not(conds ...gen.Condition) IRechargeDo Or(conds ...gen.Condition) IRechargeDo Select(conds ...field.Expr) IRechargeDo Where(conds ...gen.Condition) IRechargeDo Order(conds ...field.Expr) IRechargeDo Distinct(cols ...field.Expr) IRechargeDo Omit(cols ...field.Expr) IRechargeDo Join(table schema.Tabler, on ...field.Expr) IRechargeDo LeftJoin(table schema.Tabler, on ...field.Expr) IRechargeDo RightJoin(table schema.Tabler, on ...field.Expr) IRechargeDo Group(cols ...field.Expr) IRechargeDo Having(conds ...gen.Condition) IRechargeDo Limit(limit int) IRechargeDo Offset(offset int) IRechargeDo Count() (count int64, err error) Scopes(funcs ...func(gen.Dao) gen.Dao) IRechargeDo Unscoped() IRechargeDo Create(values ...*model.Recharge) error CreateInBatches(values []*model.Recharge, batchSize int) error Save(values ...*model.Recharge) error First() (*model.Recharge, error) Take() (*model.Recharge, error) Last() (*model.Recharge, error) Find() ([]*model.Recharge, error) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.Recharge, err error) FindInBatches(result *[]*model.Recharge, batchSize int, fc func(tx gen.Dao, batch int) error) error Pluck(column field.Expr, dest interface{}) error Delete(...*model.Recharge) (info gen.ResultInfo, err error) Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) Updates(value interface{}) (info gen.ResultInfo, err error) UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) UpdateColumns(value interface{}) (info gen.ResultInfo, err error) UpdateFrom(q gen.SubQuery) gen.Dao Attrs(attrs ...field.AssignExpr) IRechargeDo Assign(attrs ...field.AssignExpr) IRechargeDo Joins(fields ...field.RelationField) IRechargeDo Preload(fields ...field.RelationField) IRechargeDo FirstOrInit() (*model.Recharge, error) FirstOrCreate() (*model.Recharge, error) FindByPage(offset int, limit int) (result []*model.Recharge, count int64, err error) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) Scan(result interface{}) (err error) Returning(value interface{}, columns ...string) IRechargeDo UnderlyingDB() *gorm.DB schema.Tabler }
type IUserDo ¶
type IUserDo interface { gen.SubQuery Debug() IUserDo WithContext(ctx context.Context) IUserDo WithResult(fc func(tx gen.Dao)) gen.ResultInfo ReplaceDB(db *gorm.DB) ReadDB() IUserDo WriteDB() IUserDo As(alias string) gen.Dao Session(config *gorm.Session) IUserDo Columns(cols ...field.Expr) gen.Columns Clauses(conds ...clause.Expression) IUserDo Not(conds ...gen.Condition) IUserDo Or(conds ...gen.Condition) IUserDo Select(conds ...field.Expr) IUserDo Where(conds ...gen.Condition) IUserDo Order(conds ...field.Expr) IUserDo Distinct(cols ...field.Expr) IUserDo Omit(cols ...field.Expr) IUserDo Join(table schema.Tabler, on ...field.Expr) IUserDo LeftJoin(table schema.Tabler, on ...field.Expr) IUserDo RightJoin(table schema.Tabler, on ...field.Expr) IUserDo Group(cols ...field.Expr) IUserDo Having(conds ...gen.Condition) IUserDo Limit(limit int) IUserDo Offset(offset int) IUserDo Count() (count int64, err error) Scopes(funcs ...func(gen.Dao) gen.Dao) IUserDo Unscoped() IUserDo Create(values ...*model.User) error CreateInBatches(values []*model.User, batchSize int) error Save(values ...*model.User) error First() (*model.User, error) Take() (*model.User, error) Last() (*model.User, error) Find() ([]*model.User, error) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.User, err error) FindInBatches(result *[]*model.User, batchSize int, fc func(tx gen.Dao, batch int) error) error Pluck(column field.Expr, dest interface{}) error Delete(...*model.User) (info gen.ResultInfo, err error) Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) Updates(value interface{}) (info gen.ResultInfo, err error) UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) UpdateColumns(value interface{}) (info gen.ResultInfo, err error) UpdateFrom(q gen.SubQuery) gen.Dao Attrs(attrs ...field.AssignExpr) IUserDo Assign(attrs ...field.AssignExpr) IUserDo Joins(fields ...field.RelationField) IUserDo Preload(fields ...field.RelationField) IUserDo FirstOrInit() (*model.User, error) FirstOrCreate() (*model.User, error) FindByPage(offset int, limit int) (result []*model.User, count int64, err error) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) Scan(result interface{}) (err error) Returning(value interface{}, columns ...string) IUserDo UnderlyingDB() *gorm.DB schema.Tabler }
type Query ¶
type Query struct { Order order Param param Recharge recharge User user // contains filtered or unexported fields }
func (*Query) Transaction ¶
func (*Query) WithContext ¶
type QueryTx ¶
func (*QueryTx) RollbackTo ¶
Click to show internal directories.
Click to hide internal directories.