dao

package
v0.0.0-...-e3494e8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Q                = new(Query)
	Activity         *activity
	ActivityUser     *activityUser
	Group            *group
	GroupApplication *groupApplication
	GroupMember      *groupMember
	User             *user
)

Functions

func SetDefault

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

Types

type IActivityDo

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

type IActivityUserDo

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

type IGroupApplicationDo

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

type IGroupDo

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

type IGroupMemberDo

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