mirror of
https://github.com/Dvorinka/Primora.git
synced 2026-10-28 07:41:23 +00:00
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:
1 parent
f9e7002048
commit
8892c6dc43
11 files changed
+489
-8
No files matched your search
@@ -124,10 +124,22 @@ export class CollectionsService {
|
||||
collectionId,
|
||||
limit = 50,
|
||||
offset,
|
||||
filter,
|
||||
order,
|
||||
}: {
|
||||
collectionId: string,
|
||||
limit?: number,
|
||||
offset?: number,
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
filter?: string,
|
||||
/**
|
||||
* Comma-separated `field.asc|field.desc` list (default `created_at.desc`). Dotted paths index into document data.
|
||||
*
|
||||
*/
|
||||
order?: string,
|
||||
}): CancelablePromise<DocumentListResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
@@ -138,6 +150,8 @@ export class CollectionsService {
|
||||
query: {
|
||||
'limit': limit,
|
||||
'offset': offset,
|
||||
'filter': filter,
|
||||
'order': order,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user