query

package
v0.0.0-...-31a32bb Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Q             = new(Query)
	ChatGroup     *chatGroup
	ChatGroupUser *chatGroupUser
	Contact       *contact
	Message       *message
	Robot         *robot
	User          *user
)

Functions

func SetDefault

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

Types

type IChatGroupDo

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

	GetByID(id int64) (result *model.ChatGroup, err error)
}

type IChatGroupUserDo

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

	GetByID(id int64) (result *model.ChatGroupUser, err error)
}

type IContactDo

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

	GetByID(id int64) (result *model.Contact, err error)
}

type IMessageDo

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

	GetByID(id int64) (result *model.Message, err error)
}

type IRobotDo

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

	GetByID(id int64) (result *model.Robot, err error)
}

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

	GetByID(id int64) (result *model.User, err error)
}

type Query

type Query struct {
	ChatGroup     chatGroup
	ChatGroupUser chatGroupUser
	Contact       contact
	Message       message
	Robot         robot
	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