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