Class Cursor

java.lang.Object
io.vertx.mutiny.sqlclient.Cursor
All Implemented Interfaces:
MutinyDelegate

public class Cursor extends Object implements MutinyDelegate
A cursor that reads progressively rows from the database, it is useful for reading very large result sets.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

See Also:
  • Cursor
  • Field Details

  • Constructor Details

    • Cursor

      public Cursor(io.vertx.sqlclient.Cursor delegate)
      Create a new instance of Cursor delegating to the given (non-null) instance of Cursor.
    • Cursor

      public Cursor(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.sqlclient.Cursor getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • read

      @CheckReturnValue public io.smallrye.mutiny.Uni<RowSet<Row>> read(int count)
      Read rows from the cursor, the result is provided asynchronously to the handler.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      count - the amount of rows to read
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • Cursor.read(int)
    • readAndAwait

      public RowSet<Row> readAndAwait(int count)
      Read rows from the cursor, the result is provided asynchronously to the handler.

      Unlike the bare Vert.x variant, this method returns a RowSet<Row>. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      count - the amount of rows to read
      Returns:
      The operation result
      See Also:
      • Cursor.read(int)
    • readAndForget

      public Cursor readAndForget(int count)
      Read rows from the cursor, the result is provided asynchronously to the handler.

      Unlike the bare Vert.x variant, this method ignores the RowSet<Row> result or any failure.

      Parameters:
      count - the amount of rows to read
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • Cursor.read(int)
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
      Release the cursor.

      It should be called for prepared queries executed with a fetch size.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • Cursor.close()
    • closeAndAwait

      public void closeAndAwait()
      Release the cursor.

      It should be called for prepared queries executed with a fetch size.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      See Also:
      • Cursor.close()
    • closeAndForget

      public Cursor closeAndForget()
      Release the cursor.

      It should be called for prepared queries executed with a fetch size.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • Cursor.close()
    • rowDescriptor

      public RowDescriptor rowDescriptor()
      Describes rows loaded with read(int).

      This returns null until the first set of rows is fetched from the database.

    • hasMore

      public boolean hasMore()
      Returns true when the cursor has results in progress and the read(int) should be called to retrieve them.
      Returns:
      whether the cursor has more results,
    • isClosed

      public boolean isClosed()
      Returns:
      whether the cursor is closed
    • newInstance

      public static Cursor newInstance(io.vertx.sqlclient.Cursor delegate)
      Creates a new instance of the Cursor.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object