Documentation ¶
Index ¶
- func CustomPagination(pagination *Pagination) string
- func Paginate(pagination *Pagination) func(db *gorm.DB) *gorm.DB
- type ITable
- type Pagination
- type Repo
- func (r *Repo[T]) BaseModel(ctx context.Context, arg ...func(*gorm.DB)) *gorm.DB
- func (r *Repo[T]) BatchCreate(ctx context.Context, data []*T) error
- func (r *Repo[T]) Create(ctx context.Context, data *T) error
- func (r *Repo[T]) DeleteById(ctx context.Context, id int64) error
- func (r *Repo[T]) DeleteWhere(ctx context.Context, where string, args ...interface{}) error
- func (r *Repo[T]) FindAll(ctx context.Context, arg ...func(*gorm.DB)) ([]*T, error)
- func (r *Repo[T]) FindById(ctx context.Context, id int64) (*T, error)
- func (r *Repo[T]) FindByIds(ctx context.Context, ids []int64) ([]*T, error)
- func (r *Repo[T]) FindByWhere(ctx context.Context, where string, args ...any) (*T, error)
- func (r *Repo[T]) FindCustom(ctx context.Context, arg ...func(*gorm.DB)) (*T, error)
- func (r *Repo[T]) Model(ctx context.Context) *gorm.DB
- func (r *Repo[T]) QueryCount(ctx context.Context, where string, args ...any) (int64, error)
- func (r *Repo[T]) QueryExist(ctx context.Context, where string, args ...any) (bool, error)
- func (r *Repo[T]) SelectFindById(ctx context.Context, where string, id int64) (*T, error)
- func (r *Repo[T]) SelectFindByWhere(ctx context.Context, sel string, where string, args ...interface{}) (*T, error)
- func (r *Repo[T]) Txx(ctx context.Context, fc func(tx *gorm.DB) error) error
- func (r *Repo[T]) UpdateById(ctx context.Context, id any, data map[string]any) (int64, error)
- func (r *Repo[T]) UpdateWhere(ctx context.Context, data map[string]any, where string, args ...any) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomPagination ¶
func CustomPagination(pagination *Pagination) string
Types ¶
type Pagination ¶
func (*Pagination) GetLimit ¶
func (p *Pagination) GetLimit() int
func (*Pagination) GetOffset ¶
func (p *Pagination) GetOffset() int
func (*Pagination) GetPage ¶
func (p *Pagination) GetPage() int
func (*Pagination) SetPage ¶
func (p *Pagination) SetPage(page int)
func (*Pagination) SetPageSize ¶
func (p *Pagination) SetPageSize(pageSize int)
type Repo ¶
func (*Repo[T]) DeleteWhere ¶
func (*Repo[T]) FindByWhere ¶
func (*Repo[T]) FindCustom ¶
func (*Repo[T]) QueryCount ¶
func (*Repo[T]) QueryExist ¶
func (*Repo[T]) SelectFindById ¶
func (*Repo[T]) SelectFindByWhere ¶
func (*Repo[T]) UpdateById ¶
Click to show internal directories.
Click to hide internal directories.