Documentation
¶
Index ¶
- func BuildSQLQuery(tableName string, filters *[]page.FilterCondition, sorts *[]page.SortOrder, ...) (string, []any)
- func ByID[T any](ctx context.Context, table string, id int64, ...) (*T, error)
- func Count(ctx context.Context, table string, filter *[]page.FilterCondition) (int, error)
- func Eq[T any](field string, value T) page.FilterCondition
- func ExecuteSQLQuery[T any](ctx context.Context, query string, mapper func(res *sql.Rows) (*T, error), ...) ([]*T, error)
- func ExecuteSQLRow[T any](ctx context.Context, query string, mapper func(res *sql.Row) (*T, error), ...) (*T, error)
- func GetDB() *sql.DB
- func GetPagination(p dto.PaginationQuery) *page.Pagination
- func GetSortOrder(sort dto.Sorting) *[]page.SortOrder
- func Inc[T any](field string, value T) page.FilterCondition
- func IsNl[T any](field string, value T) page.FilterCondition
- func List[T any](ctx context.Context, table string, filter *[]page.FilterCondition, ...) ([]*T, error)
- func Lk[T any](field string, value T) page.FilterCondition
- func NInc[T any](field string, value T) page.FilterCondition
- func NotEq[T any](field string, value T) page.FilterCondition
- func NotNl[T any](field string, value T) page.FilterCondition
- func One[T any](ctx context.Context, table string, filter *[]page.FilterCondition, ...) (*T, error)
- func Paginator[T any](ctx context.Context, table string, filter *[]page.FilterCondition, ...) (page.Paginate[T], error)
- func ScanStructRow[T any](st T, rows *sql.Row) (*T, error)
- func ScanStructRows[T any](st T, rows *sql.Rows) (*T, error)
- func ValidateFilter(filters []page.FilterCondition, validFields map[string]bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSQLQuery ¶
func ExecuteSQLQuery ¶
func ExecuteSQLRow ¶
func GetPagination ¶
func GetPagination(p dto.PaginationQuery) *page.Pagination
func ValidateFilter ¶
func ValidateFilter(filters []page.FilterCondition, validFields map[string]bool) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.