Documentation ¶
Index ¶
- func Limit[V TableModel](val int) limit[V]
- func Offset[V TableModel](val int) offset[V]
- func OrderBy[V TableModel](val string) orderBy[V]
- func Projection[V TableModel](list ...string) projection[V]
- type Field
- type Operator
- func (o Operator[V]) Count(ctx context.Context, db *gorm.DB, finds ...Field[V]) (int64, error)
- func (d Operator[V]) CustomQuery(or bool, sql string, args ...any) Field[V]
- func (d Operator[V]) Delete(ctx context.Context, db *gorm.DB, finds ...Field[V]) error
- func (o Operator[V]) Find(ctx context.Context, db *gorm.DB, finds ...Field[V]) ([]*V, error)
- func (o Operator[V]) FindAndCount(ctx context.Context, db *gorm.DB, finds ...Field[V]) ([]*V, int64, error)
- func (o Operator[V]) Get(ctx context.Context, db *gorm.DB, finds ...Field[V]) (*V, error)
- func (o Operator[V]) Insert(ctx context.Context, db *gorm.DB, val *V) error
- func (d Operator[V]) Limit(l int) Field[V]
- func (d Operator[V]) Offset(o int) Field[V]
- func (d Operator[V]) OrderBy(ob string) Field[V]
- func (d Operator[V]) Projection(list ...string) Field[V]
- func (d Operator[V]) Update(ctx context.Context, db *gorm.DB, finds []Field[V], updates ...Field[V]) error
- type Opt
- type TableModel
- type UpdateReq
- type WithOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Limit ¶
func Limit[V TableModel](val int) limit[V]
func Offset ¶
func Offset[V TableModel](val int) offset[V]
func OrderBy ¶
func OrderBy[V TableModel](val string) orderBy[V]
func Projection ¶ added in v0.1.2
func Projection[V TableModel](list ...string) projection[V]
Types ¶
type Field ¶
func CustomQuery ¶
func CustomQuery[V TableModel](or bool, sql string, args ...any) Field[V]
type Operator ¶
type Operator[V TableModel] struct { }
func NewOperator ¶
func NewOperator[V TableModel]() Operator[V]
func (Operator[V]) CustomQuery ¶ added in v0.1.2
func (Operator[V]) FindAndCount ¶ added in v0.1.2
func (Operator[V]) Projection ¶ added in v0.1.2
type TableModel ¶
type TableModel interface {
TableName() string
}
Click to show internal directories.
Click to hide internal directories.