Commit Graph

11 Commits

Author SHA1 Message Date
Bryan Frimin
a7319e54a1 Paginate measures 500 by 500 instead of 100 by 100
Increase MaxCursorSize from 100 to 500 to allow larger page sizes, and set the measures list frontend query to fetch 500 items per page by default.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 23:55:50 +01:00
Bryan Frimin
dd99eec4f6 Clamp pagination size in page.NewCursor
Enforce minimum (25) and maximum (100) bounds on cursor size to prevent negative values or excessively large page sizes. All three API surfaces (GraphQL, MCP, CLI) funnel through NewCursor, so the fix belongs here.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2026-03-19 11:09:00 +01:00
Bryan Frimin
d6278da0d6 Fix cursorkey json serialization
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2025-11-20 19:25:29 +01:00
Bryan Frimin
59aa332ab5 Move to vanity import url
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
2025-10-31 17:01:52 +01:00
gearnode
7321862ba9 First step of mitigation migration
Signed-off-by: gearnode <bryan@frimin.fr>
2025-03-27 23:34:35 +01:00
gearnode
5a1f873d58 Use dedicated type for each order field
Signed-off-by: gearnode <bryan@frimin.fr>
2025-03-19 00:20:05 +01:00
gearnode
c73e417e5c Refactor model cursor to use orderBy
Signed-off-by: gearnode <bryan@frimin.fr>
2025-03-18 18:16:14 +01:00
gearnode
709b3363c5 Refactor pagination system with flexible ordering support
This commit overhauls the pagination system to support flexible ordering
beyond the default created_at timestamp:

- Change CursorKey from fixed byte array to structured object with ID and Value
- Add OrderField and OrderDirection types to support different sorting options
- Update SQLFragment to dynamically generate SQL based on field and direction
- Modify cursor navigation logic to consider custom ordering
- Simplify Position type to use string constants instead of numeric values
- Update Page struct to include reference to Cursor

These changes allow paginated queries to be ordered by different fields
(created_at, updated_at, name) in either ascending or descending order
while maintaining consistent cursor-based pagination behavior.

Signed-off-by: gearnode <bryan@frimin.fr>
2025-03-18 16:12:04 +01:00
gearnode
cf12d3966e Replace pgx.NamedArgs to pgx.StrictNamedArgs
Signed-off-by: gearnode <bryan@frimin.fr>
2025-03-02 08:48:52 +01:00
gearnode
743ec49972 Fix pagination
Signed-off-by: gearnode <bryan@frimin.fr>
2025-02-12 14:18:50 -08:00
gearnode
3fcf5e437c Move gid and page pkg
Signed-off-by: gearnode <bryan@frimin.fr>
2025-02-02 11:13:16 -08:00