RepositoryQueryOperations<T extends SynquillDataModel<T> > mixin
Mixin providing query operations for repositories.
- Superclass constraints
- Mixin applications
Properties
- activeRealtimeSubscriptionsForTesting → Map
-
Returns the internal map of active real-time subscriptions.
Used exclusively for testing purposes.
no setterinherited
-
apiAdapter
→ ApiAdapterBase<
T> -
The API adapter used for remote operations.
no setterinherited
-
changeController
→ StreamController<
RepositoryChange< T> > -
The stream controller for repository change events.
no setteroverride
- db → GeneratedDatabase
-
The generated database instance for this repository.
no setterinherited
- defaultLoadPolicy → DataLoadPolicy
-
Gets the default load policy from global configuration.
no setter
- defaultSavePolicy → DataSavePolicy
-
The default save policy for this repository.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- localOnly → bool
-
Whether this repository is local-only (no remote sync).
no setterinherited
- log → Logger
-
Logger for the repository - must be implemented by concrete classes
no setterinherited
- queueManager → RequestQueueManager
-
The request queue manager for handling queued operations.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
applyRealtimeDelete(
String id, {RealtimeEvent< T> ? event, Map<String, String> ? headers, Map<String, dynamic> ? extra}) → Future<void> -
Applies a realtime delete event.
inherited
-
applyRealtimeEvent(
RealtimeEvent< T> event, {Map<String, String> ? headers, Map<String, dynamic> ? extra}) → Future<void> -
Applies one realtime event to the local cache.
inherited
-
delete(
String id, {DataSavePolicy? savePolicy, Map< String, dynamic> ? extra, Map<String, String> ? headers, Set<String> ? deletionContext}) → Future<void> -
Deletes an item by its ID.
inherited
-
deleteFromLocal(
String id) → Future< void> -
Deletes an item from local storage only and notifies listeners.
inherited
-
disposeRealtimeSubscriptions(
) → Future< void> -
Disposes all active realtime subscriptions owned by this repository.
inherited
-
fetchAllFromLocal(
{QueryParams? queryParams}) → Future< List< T> > -
Fetches all items from the local database.
inherited
-
fetchAllFromLocalWithoutPendingSyncOps(
{QueryParams? queryParams}) → Future< List< T> > -
Fetches all items from the local database, excluding those
with pending sync operations.
inherited
-
fetchAllFromRemote(
{QueryParams? queryParams, Map< String, dynamic> ? extra, Map<String, String> ? headers}) → Future<List< T> > -
Fetches all items from the remote API.
inherited
-
fetchFromLocal(
String id, {QueryParams? queryParams}) → Future< T?> -
Fetches an item from the local database.
inherited
-
fetchFromRemote(
String id, {QueryParams? queryParams, Map< String, dynamic> ? extra, Map<String, String> ? headers}) → Future<T?> -
Fetches an item from the remote API.
inherited
-
findAll(
{DataLoadPolicy? loadPolicy, QueryParams? queryParams, Map< String, dynamic> ? extra, Map<String, String> ? headers}) → Future<List< T> > - Finds all items of this type.
-
findOne(
String id, {DataLoadPolicy? loadPolicy, QueryParams? queryParams, Map< String, dynamic> ? extra, Map<String, String> ? headers}) → Future<T?> - Finds an item by ID.
-
findOneOrFail(
String id, {DataLoadPolicy? loadPolicy, QueryParams? queryParams, Map< String, dynamic> ? extra, Map<String, String> ? headers}) → Future<T> - Finds an item by ID.
-
handleCascadeDeleteAfterGone(
String id, {Map< String, dynamic> ? extra, Map<String, String> ? headers}) → Future<void> -
Handles cascade delete operations when a parent model is gone (HTTP 410).
inherited
-
hasPendingRealtimeSync(
String id) → Future< bool> -
Returns whether a local sync task is pending for
id.inherited -
isExistingItem(
T item) → Future< bool> -
Checks if an item with the given ID exists in the local database.
This is a placeholder and should be overridden by concrete repositories.
inherited
-
isRealtimeRetryableError(
Object error) → bool -
Whether
errorshould retry the realtime subscription.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
realtimeRetryDelay(
int attemptNumber) → Duration -
Calculates the next realtime retry delay.
inherited
-
removeFromLocalIfExists(
String id) → Future< void> -
Removes an item from the local database if it exists.
inherited
-
saveToLocal(
T item, {Map< String, dynamic> ? extra}) → Future<void> -
Saves an item to the local database.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
truncateLocal(
) → Future< void> -
Truncates (clears) all local storage for this model type.
inherited
-
truncateLocalStorage(
) → Future< void> -
Truncates (clears) all local storage for this model type.
inherited
-
updateLocalCache(
List< T> items) → Future<void> -
Updates the local cache with remote data.
inherited
-
watchAll(
{QueryParams? queryParams, bool watchRemote = false, bool retryOnFail = true, Map< String, String> ? headers, Map<String, dynamic> ? extra}) → Stream<List< T> > - Watches all items in the local repository.
-
watchAllFromLocal(
{QueryParams? queryParams}) → Stream< List< T> > -
Watches all items from the local database.
inherited
-
watchFromLocal(
String id, {QueryParams? queryParams}) → Stream< T?> -
Watches a single item from the local database by its ID.
inherited
-
watchLocalWithRealtime<
TResult> (Stream< TResult> localStream, {required String scope, String? id, QueryParams? queryParams, Map<String, String> ? headers, Map<String, dynamic> ? extra, bool retryOnFail = true}) → Stream<TResult> -
Wraps a local watch stream and ties a remote realtime subscription to
the returned stream's lifecycle.
inherited
-
watchOne(
String id, {DataLoadPolicy? loadPolicy, QueryParams? queryParams, bool watchRemote = false, bool retryOnFail = true, Map< String, String> ? headers, Map<String, dynamic> ? extra}) → Stream<T?> - Watches a single item by its ID.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited