InMemoryQueryBuilder<T> class final

A QueryBuilder that loads every object and filters, sorts and pages them in memory.

For engines without a query language of their own. deleteAll isn't supported and throws an UnsupportedError.

Implemented types

Constructors

InMemoryQueryBuilder({required Future<List<T>> fetcher(), required Stream<List<T>> watcher()})
Creates a builder that loads the objects with fetcher and watches them with watcher.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

count() → Future<int>
Runs the query and returns the number of results.
override
deleteAll() → Future<bool>
Deletes the results, where the engine supports it.
override
findAll() → Future<List<T>>
Runs the query and returns every result.
override
findFirst() → Future<T?>
Runs the query and returns the first result, or null if there is none.
override
limit(int count) → QueryBuilder<T>
Returns at most count results.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offset(int start) → QueryBuilder<T>
Skips the first start results.
override
sortBy(SortComparator<T> comparator) → QueryBuilder<T>
Orders the results with comparator, replacing any earlier order.
override
toString() → String
A string representation of this object.
inherited
watch() → Stream<List<T>>
Emits the results now, and again whenever the collection changes.
override
where(WhereClause<T> clause) → QueryBuilder<T>
Keeps only the objects for which clause returns true. Several calls combine with AND.
override

Operators

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