query

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Q          = new(Query)
	BlackList  *blackList
	Blacklist  *blacklist
	SharedLink *sharedLink
	User       *user
)

Functions

func SetDefault

func SetDefault(db *gorm.DB, opts ...gen.DOOption)

Types

type IBlackListDo

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

type IBlacklistDo

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

type ISharedLinkDo

type ISharedLinkDo interface {
	gen.SubQuery
	Debug() ISharedLinkDo
	WithContext(ctx context.Context) ISharedLinkDo
	WithResult(fc func(tx gen.Dao)) gen.ResultInfo
	ReplaceDB(db *gorm.DB)
	ReadDB() ISharedLinkDo
	WriteDB() ISharedLinkDo
	As(alias string) gen.Dao
	Session(config *gorm.Session) ISharedLinkDo
	Columns(cols ...field.Expr) gen.Columns
	Clauses(conds ...clause.Expression) ISharedLinkDo
	Not(conds ...gen.Condition) ISharedLinkDo
	Or(conds ...gen.Condition) ISharedLinkDo
	Select(conds ...field.Expr) ISharedLinkDo
	Where(conds ...gen.Condition) ISharedLinkDo
	Order(conds ...field.Expr) ISharedLinkDo
	Distinct(cols ...field.Expr) ISharedLinkDo
	Omit(cols ...field.Expr) ISharedLinkDo
	Join(table schema.Tabler, on ...field.Expr) ISharedLinkDo
	LeftJoin(table schema.Tabler, on ...field.Expr) ISharedLinkDo
	RightJoin(table schema.Tabler, on ...field.Expr) ISharedLinkDo
	Group(cols ...field.Expr) ISharedLinkDo
	Having(conds ...gen.Condition) ISharedLinkDo
	Limit(limit int) ISharedLinkDo
	Offset(offset int) ISharedLinkDo
	Count() (count int64, err error)
	Scopes(funcs ...func(gen.Dao) gen.Dao) ISharedLinkDo
	Unscoped() ISharedLinkDo
	Create(values ...*model.SharedLink) error
	CreateInBatches(values []*model.SharedLink, batchSize int) error
	Save(values ...*model.SharedLink) error
	First() (*model.SharedLink, error)
	Take() (*model.SharedLink, error)
	Last() (*model.SharedLink, error)
	Find() ([]*model.SharedLink, error)
	FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.SharedLink, err error)
	FindInBatches(result *[]*model.SharedLink, batchSize int, fc func(tx gen.Dao, batch int) error) error
	Pluck(column field.Expr, dest interface{}) error
	Delete(...*model.SharedLink) (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) ISharedLinkDo
	Assign(attrs ...field.AssignExpr) ISharedLinkDo
	Joins(fields ...field.RelationField) ISharedLinkDo
	Preload(fields ...field.RelationField) ISharedLinkDo
	FirstOrInit() (*model.SharedLink, error)
	FirstOrCreate() (*model.SharedLink, error)
	FindByPage(offset int, limit int) (result []*model.SharedLink, 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) ISharedLinkDo
	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 ...*model.User) error
	CreateInBatches(values []*model.User, batchSize int) error
	Save(values ...*model.User) error
	First() (*model.User, error)
	Take() (*model.User, error)
	Last() (*model.User, error)
	Find() ([]*model.User, error)
	FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.User, err error)
	FindInBatches(result *[]*model.User, batchSize int, fc func(tx gen.Dao, batch int) error) error
	Pluck(column field.Expr, dest interface{}) error
	Delete(...*model.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() (*model.User, error)
	FirstOrCreate() (*model.User, error)
	FindByPage(offset int, limit int) (result []*model.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 {
	BlackList  blackList
	Blacklist  blacklist
	SharedLink sharedLink
	User       user
	// contains filtered or unexported fields
}

func Use

func Use(db *gorm.DB, opts ...gen.DOOption) *Query

func (*Query) Available

func (q *Query) Available() bool

func (*Query) Begin

func (q *Query) Begin(opts ...*sql.TxOptions) *QueryTx

func (*Query) ReadDB

func (q *Query) ReadDB() *Query

func (*Query) ReplaceDB

func (q *Query) ReplaceDB(db *gorm.DB) *Query

func (*Query) Transaction

func (q *Query) Transaction(fc func(tx *Query) error, opts ...*sql.TxOptions) error

func (*Query) WithContext

func (q *Query) WithContext(ctx context.Context) *queryCtx

func (*Query) WriteDB

func (q *Query) WriteDB() *Query

type QueryTx

type QueryTx struct {
	*Query
	Error error
}

func (*QueryTx) Commit

func (q *QueryTx) Commit() error

func (*QueryTx) Rollback

func (q *QueryTx) Rollback() error

func (*QueryTx) RollbackTo

func (q *QueryTx) RollbackTo(name string) error

func (*QueryTx) SavePoint

func (q *QueryTx) SavePoint(name string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL