Interface DittoQueryExecuting
- All Known Implementing Classes:
DittoStore,DittoTransaction
public interface DittoQueryExecuting
Defines the interface for executing DQL queries. Implemented by
DittoStore and DittoTransaction.-
Method Summary
Modifier and TypeMethodDescription@NonNull CompletionStage<DittoQueryResult> Executes a DQL query and returns items as a query result.@NonNull CompletionStage<DittoQueryResult> execute(@NonNull String query, @NonNull DittoCborSerializable.Dictionary arguments) Executes a DQL query and returns items as a query result.
-
Method Details
-
execute
Executes a DQL query and returns items as a query result. This method only returns results from the local store without waiting for anyDittoSyncSubscriptions to have caught up with the latest changes. Only use this method if your program must proceed with immediate results. Use aDittoStoreObserverto receive updates to query results as soon as they have been synced to this peer.- Parameters:
query- A string containing a valid query expressed in DQL.- Returns:
- A CompletionStage
containing a DittoQueryResultItemfor each match, or aDittoExceptionif there is a problem with the query or the store.
-
execute
@NonNull CompletionStage<DittoQueryResult> execute(@NonNull String query, @NonNull DittoCborSerializable.Dictionary arguments) Executes a DQL query and returns items as a query result. This method only returns results from the local store without waiting for anyDittoSyncSubscriptions to have caught up with the latest changes. Only use this method if your program must proceed with immediate results. Use aDittoStoreObserverto receive updates to query results as soon as they have been synced to this peer.- Parameters:
query- A string containing a valid query expressed in DQL.arguments- A map of values keyed by the placeholder name without the leading:. Example:["mileage": 123].- Returns:
- A CompletionStage
containing a DittoQueryResultItemfor each match, or aDittoExceptionif there is a problem with the query or the store.
-