query

package
v0.0.0-...-915d5cb Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Q              = new(Query)
	KeyValue       *keyValue
	RelayStatistic *relayStatistic
)

Functions

func SetDefault

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

Types

type IKeyValueDo

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

type IRelayStatisticDo

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

type Query

type Query struct {
	KeyValue       keyValue
	RelayStatistic relayStatistic
	// 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