Skip to main content

Type Alias: QueryConfig<IS, OS, CTX>

QueryConfig<IS, OS, CTX> = object

Defined in: repo/query.ts:120

The configuration for a query, specifying the database, source, predicate, sort order, schema, id, context, and limit.

Type Parameters

Type ParameterDescription
IS extends SchemaThe input schema type for the query
OS extends ISThe output schema type for the query
CTX extends ReadonlyJSONValueThe context type for additional query data

Properties

PropertyTypeDescriptionDefined in
ctx?CTXOptional context data passed to predicate and sort functionsrepo/query.ts:143
dbGoatDB<Schema>The database instance this query will operate onrepo/query.ts:126
id?stringOptional unique identifier for this queryrepo/query.ts:141
limit?numberOptional maximum number of results to returnrepo/query.ts:145
liveUpdates?booleanWhen 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:153
predicate?Predicate<IS, CTX>Optional predicate function to filter itemsrepo/query.ts:130
schema?ISOptional schema to restrict query results torepo/query.ts:139
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:135
sortDescending?booleanOptional flag that if true, flips the natural order of the sortByrepo/query.ts:137
sourceQuerySource<IS, OS>The source repository, query or path to query fromrepo/query.ts:128