feat: PostgREST-style document filtering and ordering

GET /collections/:id/documents accepts filter (field.op.value terms; eq neq
gt gte lt lte like in is; dotted paths index into document data) and order
(field.asc|desc). Whitelisted field/operator parsing with parameterized
values; plain lists keep the sqlc path. CLI gains `documents list
--collection --filter --order`; OpenAPI + generated client updated.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Tomas DvorakandDevin committed 2026-09-24 18:55:56 +02:00
1 parent f9e7002048
commit 8892c6dc43
11 files changed
+489 -8

No files matched your search

+18
View File
@@ -849,6 +849,24 @@ paths:
- $ref: "#/components/parameters/CollectionID"
- $ref: "#/components/parameters/PaginationLimit"
- $ref: "#/components/parameters/PaginationOffset"
- name: filter
in: query
description: >
PostgREST-style filters as comma-separated `field.op.value` terms.
Ops: `eq`, `neq`, `gt`, `gte`, `lt`, `lte` (numeric values),
`like` (ILIKE), `in` (pipe-separated values, e.g. `role.in.admin|editor`),
`is` (`null`|`true`|`false`). Dotted paths index into the document
data, e.g. `meta.city.eq.Prague`. Column fields `id`, `created_at`,
`updated_at` are also allowed.
schema: { type: string }
example: "status.eq.active,age.gt.18"
- name: order
in: query
description: >
Comma-separated `field.asc|field.desc` list (default `created_at.desc`).
Dotted paths index into document data.
schema: { type: string }
example: "name.asc,created_at.desc"
responses:
"200":
description: List of documents in the collection