Documentation ¶
Index ¶
- Variables
- func SetDefault(db *gorm.DB, opts ...gen.DOOption)
- type IUserDBModelDo
- 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) UserDBModel *userDBModel )
Functions ¶
Types ¶
type IUserDBModelDo ¶
type IUserDBModelDo interface { gen.SubQuery Debug() IUserDBModelDo WithContext(ctx context.Context) IUserDBModelDo WithResult(fc func(tx gen.Dao)) gen.ResultInfo ReplaceDB(db *gorm.DB) ReadDB() IUserDBModelDo WriteDB() IUserDBModelDo As(alias string) gen.Dao Session(config *gorm.Session) IUserDBModelDo Columns(cols ...field.Expr) gen.Columns Clauses(conds ...clause.Expression) IUserDBModelDo Not(conds ...gen.Condition) IUserDBModelDo Or(conds ...gen.Condition) IUserDBModelDo Select(conds ...field.Expr) IUserDBModelDo Where(conds ...gen.Condition) IUserDBModelDo Order(conds ...field.Expr) IUserDBModelDo Distinct(cols ...field.Expr) IUserDBModelDo Omit(cols ...field.Expr) IUserDBModelDo Join(table schema.Tabler, on ...field.Expr) IUserDBModelDo LeftJoin(table schema.Tabler, on ...field.Expr) IUserDBModelDo RightJoin(table schema.Tabler, on ...field.Expr) IUserDBModelDo Group(cols ...field.Expr) IUserDBModelDo Having(conds ...gen.Condition) IUserDBModelDo Limit(limit int) IUserDBModelDo Offset(offset int) IUserDBModelDo Count() (count int64, err error) Scopes(funcs ...func(gen.Dao) gen.Dao) IUserDBModelDo Unscoped() IUserDBModelDo Create(values ...*models.UserDBModel) error CreateInBatches(values []*models.UserDBModel, batchSize int) error Save(values ...*models.UserDBModel) error First() (*models.UserDBModel, error) Take() (*models.UserDBModel, error) Last() (*models.UserDBModel, error) Find() ([]*models.UserDBModel, error) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*models.UserDBModel, err error) FindInBatches(result *[]*models.UserDBModel, batchSize int, fc func(tx gen.Dao, batch int) error) error Pluck(column field.Expr, dest interface{}) error Delete(...*models.UserDBModel) (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) IUserDBModelDo Assign(attrs ...field.AssignExpr) IUserDBModelDo Joins(fields ...field.RelationField) IUserDBModelDo Preload(fields ...field.RelationField) IUserDBModelDo FirstOrInit() (*models.UserDBModel, error) FirstOrCreate() (*models.UserDBModel, error) FindByPage(offset int, limit int) (result []*models.UserDBModel, 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) IUserDBModelDo UnderlyingDB() *gorm.DB schema.Tabler FilterWithUsernameOrEmail(username string, email string) (result *models.UserDBModel, err error) }
type Query ¶
type Query struct { UserDBModel userDBModel // 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.