KoolbaseQuery class

Fluent query builder for a collection

Constructors

KoolbaseQuery({required String baseUrl, required String publicKey, required String collectionName, String? userId, Future<String?> accessTokenProvider()?, Future<void> onSessionExpired()?, CacheStore? cacheStore, WriteQueue? writeQueue, Client? client})

Properties

baseUrl → String
final
collectionName → String
final
currentFieldSearch → KoolbaseFieldSearch?
The search this query runs, if any.
no setter
hashCode → int
The hash code for this object.
no setterinherited
publicKey → String
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stream → Stream<QueryResult>
Stream of fresh results after background network refresh. Listen to this to update UI when fresh data arrives.
no setter
streamKey → String
The per-query stream identity: same construction as get's cache key, so a stream only ever carries refreshes for THIS query. Keying by collection name alone let two different queries on one collection contaminate each other's listeners with the wrong records.
no setter

Methods

embedText({required String recordId, required String vectorField, String? text}) → Future<void>
Queue an embedding job for a record on this collection. The server's embedding worker picks it up within ~1 second, calls the configured provider, and writes the resulting vector to the record.
fieldSearch(KoolbaseFieldSearch? search) → KoolbaseQuery
Searches the fields search names, on the server (#160). A searched query always asks the server and is not kept in the offline cache: its answer is the server's. Empty text: no search.
get({bool fresh = false}) → Future<QueryResult>
Fetch records — cache-first with background network refresh.
limit(int value) → KoolbaseQuery
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offset(int value) → KoolbaseQuery
orderBy(String field, {bool descending = false}) → KoolbaseQuery
populate(List<String> fields) → KoolbaseQuery
Populate related records from another collection.
searchSemantic({required String field, List<double>? queryVector, String? queryText, int limit = 20, Map<String, dynamic>? where, KoolbaseSearchMode mode = KoolbaseSearchMode.semantic, double? minSimilarity}) → Future<KoolbaseSemanticSearchResult>
final result = await Koolbase.db.collection('articles').searchSemantic( field: 'content_embedding', queryText: 'how do I configure CI/CD?', limit: 10, );
toString() → String
A string representation of this object.
inherited
where(String field, {required dynamic isEqualTo}) → KoolbaseQuery

Operators

operator ==(Object other) → bool
The equality operator.
inherited