QubeeStore
Constructor
Section titled “Constructor”new QubeeStore()Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
baseUrl |
unknown |
— |
limit |
unknown |
— |
page |
unknown |
— |
resource |
unknown |
— |
Methods
Section titled “Methods”addEmbedded()
Section titled “addEmbedded()”addEmbedded(embedded: Embedded): voidAdd embedded-resource selections to the request (PostgREST only) Automatically prevents duplicate columns for each relation
An empty column array means “all columns” (relation(*)); merging an
empty array into a relation that already has explicit columns keeps
the explicit columns.
| Parameter | Type | Description |
|---|---|---|
embedded |
Embedded |
Object mapping relation names to arrays of columns to project |
addFields()
Section titled “addFields()”addFields(fields: Fields): voidAdd selectable fields for the given model to the request Automatically prevents duplicate fields for each model
| Parameter | Type | Description |
|---|---|---|
fields |
Fields |
Object mapping model names to arrays of field names |
addFilters()
Section titled “addFilters()”addFilters(filters: Filters): voidAdd filters to the request Automatically prevents duplicate filter values for each filter key
| Parameter | Type | Description |
|---|---|---|
filters |
Filters |
Object mapping filter keys to arrays of values |
addIncludes()
Section titled “addIncludes()”addIncludes(includes: string[]): voidAdd resources to include with the request Automatically prevents duplicate includes
| Parameter | Type | Description |
|---|---|---|
includes |
string[] |
Array of resource names to include in the response |
addOperatorFilters()
Section titled “addOperatorFilters()”addOperatorFilters(filters: OperatorFilter[]): voidAdd filters with explicit operators (NestJS only) Automatically prevents duplicate operator filters for the same field + operator combination
| Parameter | Type | Description |
|---|---|---|
filters |
OperatorFilter[] |
Array of operator filter configurations |
addSelect()
Section titled “addSelect()”addSelect(fields: string[]): voidAdd flat field selection columns (NestJS only) Automatically prevents duplicate select fields
| Parameter | Type | Description |
|---|---|---|
fields |
string[] |
Array of column names to select |
addSort()
Section titled “addSort()”addSort(sort: Sort): voidAdd a field that should be used for sorting data
| Parameter | Type | Description |
|---|---|---|
sort |
Sort |
Sort configuration with field name and order (ASC/DESC) |
deleteEmbedded()
Section titled “deleteEmbedded()”deleteEmbedded(...relations: string[]): voidRemove embedded-resource relations from the state (PostgREST only)
Removes the whole relation entry, columns included.
| Parameter | Type | Description |
|---|---|---|
relations |
string[] |
Relation names to remove |
deleteFields()
Section titled “deleteFields()”deleteFields(fields: Fields): voidRemove fields for the given model Uses deep cloning to prevent mutations to the original state
| Parameter | Type | Description |
|---|---|---|
fields |
Fields |
Object mapping model names to arrays of field names to remove |
deleteFilters()
Section titled “deleteFilters()”deleteFilters(...filters: string[]): voidRemove filters from the request Uses deep cloning to prevent mutations to the original state
| Parameter | Type | Description |
|---|---|---|
filters |
string[] |
Filter keys to remove |
deleteIncludes()
Section titled “deleteIncludes()”deleteIncludes(...includes: string[]): voidRemove includes from the request
| Parameter | Type | Description |
|---|---|---|
includes |
string[] |
Include names to remove |
deleteOperatorFilters()
Section titled “deleteOperatorFilters()”deleteOperatorFilters(...fields: string[]): voidRemove operator filters by field name (NestJS only)
| Parameter | Type | Description |
|---|---|---|
fields |
string[] |
Field names of operator filters to remove |
deleteParams()
Section titled “deleteParams()”deleteParams(...keys: string[]): voidRemove extra query parameters by key
| Parameter | Type | Description |
|---|---|---|
keys |
string[] |
Parameter keys to remove |
deleteSearch()
Section titled “deleteSearch()”deleteSearch(): voidRemove the search term from the state (NestJS only)
deleteSelect()
Section titled “deleteSelect()”deleteSelect(...fields: string[]): voidRemove flat field selections from the state (NestJS only)
| Parameter | Type | Description |
|---|---|---|
fields |
string[] |
Field names to remove from selection |
deleteSorts()
Section titled “deleteSorts()”deleteSorts(...sorts: string[]): voidRemove sorts from the request by field name
| Parameter | Type | Description |
|---|---|---|
sorts |
string[] |
Field names of sorts to remove |
getSnapshot()
Section titled “getSnapshot()”getSnapshot(): QueryBuilderStateRead the current state.
The returned object is a defensive copy whose identity is stable until the
next write, which is exactly the contract useSyncExternalStore expects.
An arrow function, so it stays bound to its store when passed on its own —
useSyncExternalStore(store.subscribe, store.getSnapshot).
Returns — The current query builder state
reset()
Section titled “reset()”reset(): voidReset the query builder state to initial values Clears all fields, filters, includes, sorts and params, and resets pagination
setParam()
Section titled “setParam()”setParam(key: string, values: (string | number | boolean)[]): voidSet an extra query parameter, replacing any values it already had
Extra parameters are ones no driver models. A key that is set again keeps its original position in the query string; integer-like keys come first, as in any JavaScript object.
| Parameter | Type | Description |
|---|---|---|
key |
string |
The parameter name, emitted verbatim |
values |
(string | number | boolean)[] |
The values, percent-encoded and comma-joined on output |
setSearch()
Section titled “setSearch()”setSearch(search: string): voidSet the full-text search term (NestJS only)
| Parameter | Type | Description |
|---|---|---|
search |
string |
The search term |
subscribe()
Section titled “subscribe()”subscribe(listener: function): functionRegister a listener invoked after every state change.
An arrow function, so it stays bound to its store when passed on its own. Its identity is stable for the life of the store.
| Parameter | Type | Description |
|---|---|---|
listener |
function |
Called after each write; receives no arguments and should read the new state via getSnapshot |
Returns — A function that removes the listener
syncLastPage()
Section titled “syncLastPage()”syncLastPage(lastPage: number): voidAtomically record the lastPage value from a paginated response and
flip isLastPageKnown to true
Called exclusively by Paginator.paginate() as part of the
auto-sync contract; not intended to be invoked by consumers directly.
Keeping the two fields under a single write guarantees they cannot
drift out of sync.
| Parameter | Type | Description |
|---|---|---|
lastPage |
number |
The last page number parsed from the most recent paginated response |
