query

package
v0.0.0-...-d769f72 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Q      = new(Query)
	Chat   *chat
	Plugin *plugin
)

Functions

func SetDefault

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

Types

type IChatDo

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

type IPluginDo

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

type Query

type Query struct {
	Chat   chat
	Plugin plugin
	// 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