Class SQLRowStream

java.lang.Object
io.vertx.mutiny.ext.sql.SQLRowStream
All Implemented Interfaces:
MutinyDelegate, ReadStream<io.vertx.core.json.JsonArray>, StreamBase

public class SQLRowStream extends Object implements MutinyDelegate, ReadStream<io.vertx.core.json.JsonArray>
A ReadStream of Rows from the underlying RDBMS. This class follows the ReadStream semantics and will automatically close the underlying resources if all returned rows are returned. For cases where the results are ignored before the full processing of the returned rows is complete the close method **MUST** be called in order to release underlying resources. The interface is minimal in order to support all SQL clients not just JDBC.

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

  • Field Details

  • Constructor Details

    • SQLRowStream

      public SQLRowStream(io.vertx.ext.sql.SQLRowStream delegate)
    • SQLRowStream

      public SQLRowStream(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.sql.SQLRowStream getDelegate()
      Specified by:
      getDelegate in interface MutinyDelegate
      Specified by:
      getDelegate in interface ReadStream<io.vertx.core.json.JsonArray>
      Specified by:
      getDelegate in interface StreamBase
      Returns:
      the delegate used by this Mutiny object of generated type
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

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

      public ReadStream<io.vertx.core.json.JsonArray> fetch(long arg0)
      Specified by:
      fetch in interface ReadStream<io.vertx.core.json.JsonArray>
      Returns:
      a reference to this, so the API can be used fluently
    • pipe

      public Pipe<io.vertx.core.json.JsonArray> pipe()
      Specified by:
      pipe in interface ReadStream<io.vertx.core.json.JsonArray>
      Returns:
      a pipe
    • pipeTo

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> pipeTo(WriteStream<io.vertx.core.json.JsonArray> dst)
      Description copied from interface: ReadStream
      Pipe this ReadStream to the WriteStream.

      Elements emitted by this stream will be written to the write stream until this stream ends or fails.

      Once this stream has ended or failed, the write stream will be ended and the handler will be called with the result.

      Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

      Specified by:
      pipeTo in interface ReadStream<io.vertx.core.json.JsonArray>
      Parameters:
      dst - the destination write stream
      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • pipeToAndAwait

      public Void pipeToAndAwait(WriteStream<io.vertx.core.json.JsonArray> dst)
      Description copied from interface: ReadStream
      Blocking variant of ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream).

      This method waits 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).

      Specified by:
      pipeToAndAwait in interface ReadStream<io.vertx.core.json.JsonArray>
      Parameters:
      dst - the destination write stream
      Returns:
      the Void instance produced by the operation.
    • pipeToAndForget

      public void pipeToAndForget(WriteStream<io.vertx.core.json.JsonArray> dst)
      Description copied from interface: ReadStream
      Variant of ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream) that ignores the result of the operation.

      This method subscribes on the result of ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream) but you don't need to compose it with other operations.

      Specified by:
      pipeToAndForget in interface ReadStream<io.vertx.core.json.JsonArray>
      Parameters:
      dst - the destination write stream
    • exceptionHandler

      public SQLRowStream exceptionHandler(Consumer<Throwable> handler)
      Specified by:
      exceptionHandler in interface ReadStream<io.vertx.core.json.JsonArray>
      Specified by:
      exceptionHandler in interface StreamBase
      Parameters:
      handler - the exception handler
      Returns:
    • handler

      public SQLRowStream handler(Consumer<io.vertx.core.json.JsonArray> handler)
      Specified by:
      handler in interface ReadStream<io.vertx.core.json.JsonArray>
      Returns:
    • pause

      public SQLRowStream pause()
      Specified by:
      pause in interface ReadStream<io.vertx.core.json.JsonArray>
      Returns:
      a reference to this, so the API can be used fluently
    • resume

      public SQLRowStream resume()
      Specified by:
      resume in interface ReadStream<io.vertx.core.json.JsonArray>
      Returns:
      a reference to this, so the API can be used fluently
    • endHandler

      public SQLRowStream endHandler(Runnable endHandler)
      Specified by:
      endHandler in interface ReadStream<io.vertx.core.json.JsonArray>
      Returns:
    • column

      public int column(String name)
      Parameters:
      name - the column name
      Returns:
      the json array index
    • columns

      public List<String> columns()
      Returns:
      the list of columns names returned by the query
    • resultSetClosedHandler

      public SQLRowStream resultSetClosedHandler(Runnable handler)
      Parameters:
      handler - called when the current result set is closed
      Returns:
    • moreResults

      public void moreResults()
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
      Closes the stream/underlying cursor(s). The actual close happens asynchronously.

      Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • closeAndAwait

      public Void closeAndAwait()
      Blocking variant of close().

      This method waits 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).

      Returns:
      the Void instance produced by the operation.
    • closeAndForget

      public void closeAndForget()
      Variant of close() that ignores the result of the operation.

      This method subscribes on the result of close(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from close() but you don't need to compose it with other operations.

    • toMulti

      @CheckReturnValue public io.smallrye.mutiny.Multi<io.vertx.core.json.JsonArray> toMulti()
      Specified by:
      toMulti in interface ReadStream<io.vertx.core.json.JsonArray>
    • toBlockingIterable

      public Iterable<io.vertx.core.json.JsonArray> toBlockingIterable()
    • toBlockingStream

      public Stream<io.vertx.core.json.JsonArray> toBlockingStream()
    • newInstance

      public static SQLRowStream newInstance(io.vertx.ext.sql.SQLRowStream arg)