io.vertx.ext.sql

## Interface SQLRowStream

- All Superinterfaces:
    ReadStream<JsonArray>, StreamBase

      public interface SQLRowStream
      extends ReadStream<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.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes the stream/underlying cursor(s).
    `void` | `close(Handler<AsyncResult<Void>> handler)` Closes the stream/underlying cursor(s).
    `int` | `column(String name)` Will convert the column name to the json array index.
    `List<String>` | `columns()` Returns all column names available in the underlying resultset.
    `SQLRowStream` | `endHandler(Handler<Void> endHandler)` Set an end handler.
    `SQLRowStream` | `exceptionHandler(Handler<Throwable> handler)` Set an exception handler on the read stream.
    `SQLRowStream` | `handler(Handler<JsonArray> handler)` Set a data handler.
    `void` | `moreResults()` Request for more results if available
    `SQLRowStream` | `pause()` Pause the `ReadStream`, it sets the buffer in `fetch` mode and clears the actual demand.
    `SQLRowStream` | `resultSetClosedHandler(Handler<Void> handler)` Event handler when a resultset is closed.
    `SQLRowStream` | `resume()` Resume reading, and sets the buffer in `flowing` mode.

    - ### Methods inherited from interface io.vertx.core.streams.ReadStream

      `fetch, pipe, pipeTo, pipeTo`

- - ### Method Detail

    - #### exceptionHandler

          SQLRowStream exceptionHandler(Handler<Throwable> handler)

      Description copied from interface: `ReadStream`
      Set an exception handler on the read stream.
      Specified by:
        `exceptionHandler` in interface `ReadStream<JsonArray>`
      Specified by:
        `exceptionHandler` in interface `StreamBase`
      Parameters:
        `handler` - the exception handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### handler

          SQLRowStream handler(Handler<JsonArray> handler)

      Description copied from interface: `ReadStream`
      Set a data handler. As data is read, the handler will be called with the data.
      Specified by:
        `handler` in interface `ReadStream<JsonArray>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### pause

          SQLRowStream pause()

      Description copied from interface: `ReadStream`
      Pause the `ReadStream`, it sets the buffer in `fetch` mode and clears the actual demand.

      While it's paused, no data will be sent to the data `handler`.

      Specified by:
        `pause` in interface `ReadStream<JsonArray>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### resume

          SQLRowStream resume()

      Description copied from interface: `ReadStream`
      Resume reading, and sets the buffer in `flowing` mode.

      If the `ReadStream` has been paused, reading will recommence on it.
      Specified by:
        `resume` in interface `ReadStream<JsonArray>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### endHandler

          SQLRowStream endHandler(Handler<Void> endHandler)

      Description copied from interface: `ReadStream`
      Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
      Specified by:
        `endHandler` in interface `ReadStream<JsonArray>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### column

          int column(String name)

      Will convert the column name to the json array index.
      Parameters:
        `name` - the column name
      Returns:
        the json array index

    - #### columns

          List<String> columns()

      Returns all column names available in the underlying resultset. One needs to carefully use this method since in contrast to the singular version it does not perform case insensitive lookups or takes alias in consideration on the column names.
      Returns:
        the list of columns names returned by the query

    - #### resultSetClosedHandler

          SQLRowStream resultSetClosedHandler(Handler<Void> handler)

      Event handler when a resultset is closed. This is useful to request for more results.
      Parameters:
        `handler` - called when the current result set is closed

    - #### moreResults

          void moreResults()

      Request for more results if available

    - #### close

          void close()

      Closes the stream/underlying cursor(s). The actual close happens asynchronously.

    - #### close

          void close(Handler<AsyncResult<Void>> handler)

      Closes the stream/underlying cursor(s). The actual close happens asynchronously.
      Parameters:
        `handler` - called when the stream/underlying cursor(s) is(are) closed

Copyright © 2020 Eclipse. All rights reserved.