java.lang.Object
com.couchbase.columnar.client.java.Scope
All Implemented Interfaces:
Queryable

@ThreadSafe public final class Scope extends Object implements Queryable
  • Method Details

    • database

      public Database database()
      Returns the database this scope belongs to.
    • name

      public String name()
    • executeQuery

      public QueryResult executeQuery(String statement, Consumer<QueryOptions> options)
      Description copied from interface: Queryable
      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: Queryable.executeStreamingQuery(String, Consumer, Consumer).

      Specified by:
      executeQuery in interface Queryable
      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.
    • executeStreamingQuery

      public QueryMetadata executeStreamingQuery(String statement, Consumer<Row> rowAction, Consumer<QueryOptions> options)
      Description copied from interface: Queryable
      Executes a query statement using the specified options, (query parameters, etc.), and passes result rows to the given rowAction 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.

      Specified by:
      executeStreamingQuery in interface Queryable
      Parameters:
      statement - The Columnar SQL++ statement to execute.
      options - A callback for specifying custom query options.
      Returns:
      Query metadata.
    • toString

      public String toString()
      Overrides:
      toString in class Object