PostgrestResponseStrategy
ArchivedThese are the docs for ng-qubee 3.8. Read the 4.0 docs for @qubeejs/angular.
Defined in: src/lib/strategies/postgrest-response.strategy.ts:35
Response strategy for the PostgREST driver
PostgREST (and Supabase, which wraps it) returns a bare array body for
collection endpoints. Pagination metadata is carried in the
Content-Range HTTP response header, e.g. 0-9/50 meaning “items 0–9
out of 50 total”. Consumers opt into totals by sending the
Prefer: count=exact request header.
This strategy expects the consumer to pass the array body as response
(or a plain object with response[options.data] pointing at the array)
and the response headers via the optional headers bag. See
PaginationService.paginate() for the call-site shape.
https://postgrest.org/en/stable/references/api/pagination_count.html
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PostgrestResponseStrategy():
PostgrestResponseStrategy
Returns
Section titled “Returns”PostgrestResponseStrategy
Methods
Section titled “Methods”paginate()
Section titled “paginate()”paginate<
T>(response,options,headers?):PaginatedCollection<T>
Defined in: src/lib/strategies/postgrest-response.strategy.ts:53
Parse a PostgREST response into a typed PaginatedCollection
Type Parameters
Section titled “Type Parameters”T extends IPaginatedObject
Parameters
Section titled “Parameters”response
Section titled “response”Record<string, unknown>
The raw response. Either the array body directly, or
an object with the array at response[options.data].
options
Section titled “options”The response key configuration (only options.data is
consulted; all pagination metadata comes from the Content-Range header).
headers?
Section titled “headers?”Optional HTTP response headers. The Content-Range
header drives page/total derivation; omission is tolerated and yields
a collection with undefined bounds (auto-sync will leave
isLastPageKnown at false).
Returns
Section titled “Returns”A typed PaginatedCollection instance