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