Versions in this module Expand all Collapse all v0 v0.5.1 Jun 10, 2025 Changes in this version + var ErrInvalidPageSize = errors.New("invalid page size") + type CRUD interface + Create func(ctx context.Context, e *T) (sql.Result, error) + Delete func(ctx context.Context, id I) (sql.Result, error) + DeleteAll func(ctx context.Context) (sql.Result, error) + GetAll func(ctx context.Context) ([]T, error) + GetByID func(ctx context.Context, id I) (T, error) + GetByIDs func(ctx context.Context, ids []I) ([]T, error) + Update func(ctx context.Context, id I, e *T) (sql.Result, error) + type DebugFunc func(sql string, args ...any) + type Page struct + Content []T + Number uint + Size uint + Total uint64 + TotalPages uint + type PageOpt func(*PageParams) + func WithPageNumber(number uint) PageOpt + func WithPageSize(size uint) PageOpt + func WithSortBy(column string) PageOpt + func WithSortDesc(column string) PageOpt + type PageParams struct + PageNumber uint + PageSize uint + SortBy []string + SortDesc bool + func (p PageParams) Validate() error + type PageResolver interface + Count func(ctx context.Context) (uint64, error) + GetPage func(ctx context.Context, opts ...PageOpt) (Page[T], error) + type SQLExecutor interface + BeginTx func(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error) + Exec func(ctx context.Context, query string, args ...any) (sql.Result, error) + SelectMany func(ctx context.Context, dest any, query string, args ...any) error + SelectOne func(ctx context.Context, dest any, query string, args ...any) error