query

package
v0.0.0-...-d357a17 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Q               = new(Query)
	KeyModel        *keyModel
	KeyRotatedModel *keyRotatedModel
)

Functions

func SetDefault

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

Types

type IKeyModelDo

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

	GetByID(id string) (result *dbmodel.KeyModel, err error)
}

type IKeyRotatedModelDo

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

	GetByID(id string) (result *dbmodel.KeyRotatedModel, err error)
}

type Query

type Query struct {
	KeyModel        keyModel
	KeyRotatedModel keyRotatedModel
	// 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 }

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