pagesql

package
v0.0.0-...-0f16109 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSortColumn = "id"

Functions

func WriteQuery

func WriteQuery(parameters Parameters) (query, countQuery string, args []interface{})

WriteQuery generates a SQL query for paginated results and a count query based on the provided filters, sorting, and pagination parameters. It constructs a SELECT query with conditions for filtering, ordering, pagination (LIMIT and OFFSET) and a COUNT query for the total number of records.

Types

type Parameters

type Parameters struct {
	Table      string
	Fields     []string
	Filters    map[paginate.FilterParameter]paginate.Filter
	SortColumn string
	Descending bool
	Limit      uint64
	Offset     uint64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL