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