Documentation ¶
Index ¶
- func CommonDeal(db *gorm.DB, example interface{}, option *meta.GetOption) (tx *gorm.DB)
- func CompositeQuery(db *gorm.DB, chainRoot *meta.WhereNode) (tx *gorm.DB)
- type BaseModel
- type BasicCURD
- type CreateMixin
- type DeleteMixin
- type GetMixin
- type PgModel
- func (p *PgModel[T]) Count(ctx context.Context, t *T, option *meta.GetOption) (int64, error)
- func (p *PgModel[T]) CountComplex(ctx context.Context, example *T, condition *meta.WhereNode, ...) (int64, error)
- func (p *PgModel[T]) CountComplexDB(ctx context.Context, example *T, condition *meta.WhereNode, ...) *gorm.DB
- func (p *PgModel[T]) CountComplexUnscoped(ctx context.Context, example *T, condition *meta.WhereNode, ...) (int64, error)
- func (p *PgModel[T]) CountUnscoped(ctx context.Context, t *T, option *meta.GetOption) (int64, error)
- func (p *PgModel[T]) Create(ctx context.Context, t *T, option *meta.CreateOption) error
- func (p *PgModel[T]) Creates(ctx context.Context, t []*T, option *meta.CreateCollectionOption) error
- func (p *PgModel[T]) Delete(ctx context.Context, t *T, option *meta.DeleteOption) error
- func (p PgModel[T]) DeleteByIds(ctx context.Context, ids []uint) error
- func (p *PgModel[T]) DeleteCollection(ctx context.Context, t []*T, option *meta.DeleteCollectionOption) []error
- func (p *PgModel[T]) Get(ctx context.Context, t *T, option *meta.GetOption) (*T, error)
- func (p *PgModel[T]) List(ctx context.Context, t *T, option *meta.ListOption) ([]*T, error)
- func (p *PgModel[T]) ListComplex(ctx context.Context, example *T, condition *meta.WhereNode, ...) ([]*T, error)
- func (p *PgModel[T]) ListComplexDB(ctx context.Context, example *T, condition *meta.WhereNode, ...) *gorm.DB
- func (p *PgModel[T]) ListComplexUnscoped(ctx context.Context, example *T, condition *meta.WhereNode, ...) ([]*T, error)
- func (p *PgModel[T]) ListDB(ctx context.Context, t *T, option *meta.ListOption) *gorm.DB
- func (p *PgModel[T]) ListUnscoped(ctx context.Context, t *T, option *meta.ListOption) ([]*T, error)
- func (p *PgModel[T]) Save(ctx context.Context, t *T, option *meta.UpdateOption) error
- func (p *PgModel[T]) Update(ctx context.Context, t *T, option *meta.UpdateOption) error
- func (p *PgModel[T]) UpdateByWhere(ctx context.Context, node *meta.WhereNode, example *T, ...) error
- func (p *PgModel[T]) UpdateCollection(ctx context.Context, t []*T, option *meta.UpdateCollectionOption) []error
- type UpdateMixin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommonDeal ¶
Types ¶
type BasicCURD ¶
type BasicCURD[T BaseModel] interface { CreateMixin[T] DeleteMixin[T] UpdateMixin[T] GetMixin[T] }
type CreateMixin ¶
type DeleteMixin ¶
type GetMixin ¶
type GetMixin[T BaseModel] interface { Get(ctx context.Context, t *T, option *meta.GetOption) (*T, error) Count(ctx context.Context, t *T, option *meta.GetOption) (int64, error) CountComplex(ctx context.Context, example *T, condition *meta.WhereNode, option *meta.GetOption) (int64, error) List(ctx context.Context, t *T, option *meta.ListOption) ([]*T, error) ListComplex(ctx context.Context, example *T, condition *meta.WhereNode, option *meta.ListOption) ([]*T, error) ListDB(ctx context.Context, t *T, option *meta.ListOption) *gorm.DB ListComplexDB(ctx context.Context, example *T, condition *meta.WhereNode, option *meta.ListOption) *gorm.DB }
type PgModel ¶
func (*PgModel[T]) CountComplex ¶
func (*PgModel[T]) CountComplexDB ¶
func (*PgModel[T]) CountComplexUnscoped ¶
func (*PgModel[T]) CountUnscoped ¶
func (PgModel[T]) DeleteByIds ¶
func (*PgModel[T]) DeleteCollection ¶
func (*PgModel[T]) ListComplex ¶
func (*PgModel[T]) ListComplexDB ¶
func (*PgModel[T]) ListComplexUnscoped ¶
func (*PgModel[T]) ListUnscoped ¶
func (*PgModel[T]) UpdateByWhere ¶
func (*PgModel[T]) UpdateCollection ¶
type UpdateMixin ¶
type UpdateMixin[T BaseModel] interface { Update(ctx context.Context, t *T, option *meta.UpdateOption) error UpdateByWhere(ctx context.Context, node *meta.WhereNode, example *T, option *meta.UpdateOption) error UpdateCollection(ctx context.Context, t []*T, option *meta.UpdateCollectionOption) []error Save(ctx context.Context, t *T, option *meta.UpdateOption) error }
Click to show internal directories.
Click to hide internal directories.