Ditto 5.0.0
Loading...
Searching...
No Matches
DittoSDK.Store.IDittoQueryExecuting Interface Reference

Defines the interface for executing DQL queries. More...

Inheritance diagram for DittoSDK.Store.IDittoQueryExecuting:
DittoSDK.Store.DittoStore DittoSDK.Store.DittoTransaction

Public Member Functions

Task< DittoQueryResultExecuteAsync (string query, Dictionary< string, object > arguments=default)
 Executes a DQL query and returns matching items as a query result.

Detailed Description

Defines the interface for executing DQL queries.

Member Function Documentation

◆ ExecuteAsync()

Task< DittoQueryResult > DittoSDK.Store.IDittoQueryExecuting.ExecuteAsync ( string query,
Dictionary< string, object > arguments = default )

Executes a DQL query and returns matching items as a query result.

This method only returns results from the local store without waiting for any DittoSyncSubscription to catch up with the latest changes. Only use this method if your program must proceed with immediate results. Use a DittoStoreObserver to receive updates to query results as soon as they have been synced to this peer.

Parameters
queryA string containing a valid query expressed in DQL.
argumentsA dictionary of values keyed by the placeholder name without the leading :. Example: new Dictionary<string, object> { { "mileage", 123 } }.
Returns
A DittoQueryResult containing a collection of DittoQueryResultItem instances for each match.
Exceptions
DittoQueryInvalidExceptionThrown if the query string is not valid DQL.
DittoQueryArgumentsInvalidExceptionThrown if the arguments dictionary is invalid (contains unsupported types).
DittoTransactionReadOnlyExceptionThrown when a mutating query is executed on a read-only transaction.
DittoExceptionOther DittoException errors may also be thrown.

Implemented in DittoSDK.Store.DittoStore, and DittoSDK.Store.DittoTransaction.