query

package
v0.0.0-...-f106b7c Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Q              = new(Query)
	Businessowner  *businessowner
	Driver         *driver
	DriverLocation *driverLocation
	Order          *order
	Route          *route
	User           *user
)

Functions

func SetDefault

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

Types

type IBusinessownerDo

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

type IDriverDo

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

type IDriverLocationDo

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

type IOrderDo

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

type IRouteDo

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