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