Type Alias: QueryConfig<IS, OS, CTX>
QueryConfig<
IS,OS,CTX> =object
Defined in: repo/query.ts:130
The configuration for a query, specifying the database, source, predicate, sort order, schema, id, context, and limit.
Type Parameters
| Type Parameter | Description |
|---|---|
IS extends Schema | The input schema type for the query |
OS extends IS | The output schema type for the query |
CTX extends ReadonlyJSONValue | The context type for additional query data |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
ctx? | CTX | Optional context data passed to predicate and sort functions | repo/query.ts:158 |
db | GoatDB<Schema> | The database instance this query will operate on | repo/query.ts:136 |
id? | string | Optional unique identifier for this query | repo/query.ts:156 |
limit? | number | Optional maximum number of results to return | repo/query.ts:160 |
liveUpdates? | boolean | When true (default), query membership and sort order update immediately when a ManagedItem is edited via set(), without waiting for the 300ms commit delay. Set to false to revert to commit-only update behavior. Rebase events are always ignored since they do not change the document's logical value. | repo/query.ts:168 |
predicate? | Predicate<IS, CTX> | Optional predicate function to filter items | repo/query.ts:140 |
schema? | IS | Optional schema to restrict query results to | repo/query.ts:154 |
sortBy? | SortDescriptor<OS, CTX> | keyof SchemaDataType<OS> | Optional function or field name to determine sort order of results. If a function is provided, it will be used as a custom comparator. If a field name is provided, results will be sorted by that field's values using standard comparison rules. | repo/query.ts:145 |
sortDescending? | boolean | Optional flag that if true, flips the natural order of the sortBy WARNING: When adding a field that changes query behavior (sorting, filtering, limiting, live updates), you MUST also add it to the key computation in generateQueryId() below so the cache identity captures the difference. Otherwise distinct configurations will collide. | repo/query.ts:152 |
source | QuerySource<IS, OS> | The source repository, query or path to query from | repo/query.ts:138 |