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