Class Scope
java.lang.Object
com.couchbase.analytics.client.java.Scope
- All Implemented Interfaces:
Queryable
-
Method Summary
Modifier and TypeMethodDescriptiondatabase()Returns the database this scope belongs to.executeQuery(String statement, Consumer<QueryOptions> options) Executes a query statement using the specified options (query parameters, etc.), and buffers all result rows in memory.executeStreamingQuery(String statement, Consumer<Row> rowAction, Consumer<QueryOptions> options) Executes a query statement using the specified options, (query parameters, etc.), and passes result rows to the givenrowActioncallback, one by one as they arrive from the server.name()startQuery(String statement, Consumer<StartQueryOptions> options) Starts executing a query statement using the specified options (query parameters, etc.), and returns a "handle" for fetching the results later.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.couchbase.analytics.client.java.Queryable
executeQuery, executeStreamingQuery, startQuery
-
Method Details
-
database
Returns the database this scope belongs to. -
name
-
startQuery
Description copied from interface:QueryableStarts executing a query statement using the specified options (query parameters, etc.), and returns a "handle" for fetching the results later.Use this execution mode to ensure resilience against network interruptions during long-running queries.
- Specified by:
startQueryin interfaceQueryable- Parameters:
statement- The Analytics SQL++ statement to execute.options- A callback for specifying custom query options.- Returns:
- A handle for fetching the result later.
-
executeQuery
Description copied from interface:QueryableExecutes a query statement using the specified options (query parameters, etc.), and buffers all result rows in memory.If the results are not known to fit in memory, consider using the streaming version that takes a row action callback:
Queryable.executeStreamingQuery(String, Consumer, Consumer).- Specified by:
executeQueryin interfaceQueryable- Parameters:
statement- The Analytics SQL++ statement to execute.options- A callback for specifying custom query options.- Returns:
- A query result consisting of metadata and a list of rows.
-
executeStreamingQuery
public QueryMetadata executeStreamingQuery(String statement, Consumer<Row> rowAction, Consumer<QueryOptions> options) Description copied from interface:QueryableExecutes a query statement using the specified options, (query parameters, etc.), and passes result rows to the givenrowActioncallback, one by one as they arrive from the server.The callback action is guaranteed to execute in the same thread (or virtual thread) that called this method. If the callback throws an exception, the query is cancelled and the exception is re-thrown by this method.
- Specified by:
executeStreamingQueryin interfaceQueryable- Parameters:
statement- The Analytics SQL++ statement to execute.options- A callback for specifying custom query options.- Returns:
- Query metadata.
-
toString
-