Interface Queryable
-
Method Summary
Modifier and TypeMethodDescriptiondefault QueryResult
executeQuery
(String statement) Executes a query statement using default options (no query parameters, etc.), and buffers all result rows in memory.executeQuery
(String statement, Consumer<QueryOptions> options) Executes a query statement using the specified options (query parameters, etc.), and buffers all result rows in memory.default QueryMetadata
executeStreamingQuery
(String statement, Consumer<Row> rowAction) Executes a query statement and passes result rows to the givenrowAction
callback, one by one as they arrive from the server.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 givenrowAction
callback, one by one as they arrive from the server.
-
Method Details
-
executeQuery
Executes 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:
executeStreamingQuery(String, Consumer, Consumer)
.- Parameters:
statement
- The Columnar SQL++ statement to execute.options
- A callback for specifying custom query options.- Returns:
- A query result consisting of metadata and a list of rows.
- Throws:
CancellationException
- if the calling thread is interrupted.TimeoutException
- if the query does not complete before the timeout expires.QueryException
- if the server response indicates an error occurred.InvalidCredentialException
- if the server rejects the user credentials.
-
executeQuery
Executes a query statement using default options (no query parameters, etc.), and buffers all result rows in memory.If the statement has parameters, use the overload that takes options:
executeQuery(String, Consumer)
.If the results are not known to fit in memory, consider using the streaming version that takes a row action callback:
executeStreamingQuery(String, Consumer)
.- Parameters:
statement
- The Columnar SQL++ statement to execute.- Returns:
- A query result consisting of metadata and a list of rows.
- Throws:
CancellationException
- if the calling thread is interrupted.TimeoutException
- if the query does not complete before the timeout expires.QueryException
- if the server response indicates an error occurred.InvalidCredentialException
- if the server rejects the user credentials.
-
executeStreamingQuery
QueryMetadata 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 givenrowAction
callback, 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.
- Parameters:
statement
- The Columnar SQL++ statement to execute.options
- A callback for specifying custom query options.- Returns:
- Query metadata.
- Throws:
CancellationException
- if the calling thread is interrupted.TimeoutException
- if the query does not complete before the timeout expires.QueryException
- if the server response indicates an error occurred.RuntimeException
- if the row action callback throws an exception.InvalidCredentialException
- if the server rejects the user credentials.
-
executeStreamingQuery
Executes a query statement and passes result rows to the givenrowAction
callback, 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.
If the statement has parameters, use the overload that takes options:
executeStreamingQuery(String, Consumer, Consumer)
.- Parameters:
statement
- The Columnar SQL++ statement to execute.- Returns:
- Query metadata.
- Throws:
CancellationException
- if the calling thread is interrupted.TimeoutException
- if the query does not complete before the timeout expires.QueryException
- if the server response indicates an error occurred.InvalidCredentialException
- if the server rejects the user credentials.RuntimeException
- if the row action callback throws an exception.
-