SQLRowStream

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.

package

Default

Methods

__construct

__construct() 

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

close( $arg0 = null) : void

close()

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

param $handler [callable] called when the stream/underlying cursor(s) is(are) closed close($handler)

Arguments

$arg0

callable

Will convert the column name to the json array index.

column( $arg0) : integer

Arguments

$arg0

string

Response

integer

the json array index

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.

columns() : array

Response

array

the list of columns names returned by the query

endHandler

endHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

exceptionHandler

exceptionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

Fetch the specified <code>amount</code> of elements. If the <code>ReadStream</code> has been paused, reading will recommence with the specified <code>amount</code> of items, otherwise the specified <code>amount</code> will be added to the current stream demand.

fetch( $arg0) : $this

Arguments

$arg0

integer

Response

$this

a reference to this, so the API can be used fluently

handler

handler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

Request for more results if available

moreResults() : void

pause

pause() : $this

Response

$this

Event handler when a resultset is closed. This is useful to request for more results.

resultSetClosedHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

resume

resume() : $this

Response

$this