new 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.
- Source:
Methods
close(handler)
Closes the stream/underlying cursor(s). The actual close happens asynchronously.
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function | called when the stream/underlying cursor(s) is(are) closed |
- Source:
column(name) → {number}
Will convert the column name to the json array index.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | the column name |
- Source:
Returns:
the json array index
- Type
- number
columns() → {Array.<string>}
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.
- Source:
Returns:
the list of columns names returned by the query
- Type
- Array.<string>
endHandler(endHandler) → {SQLRowStream}
Parameters:
| Name | Type | Description |
|---|---|---|
endHandler |
function |
- Source:
Returns:
- Type
- SQLRowStream
exceptionHandler(handler) → {SQLRowStream}
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function |
- Source:
Returns:
- Type
- SQLRowStream
fetch(amount) → {ReadStream}
Fetch the specified
amount of elements. If the ReadStream has been paused, reading will
recommence with the specified amount of items, otherwise the specified amount will
be added to the current stream demand.
Parameters:
| Name | Type | Description |
|---|---|---|
amount |
number |
- Source:
Returns:
a reference to this, so the API can be used fluently
- Type
- ReadStream
handler(handler) → {SQLRowStream}
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function |
- Source:
Returns:
- Type
- SQLRowStream
moreResults()
Request for more results if available
- Source:
pause() → {SQLRowStream}
- Source:
Returns:
- Type
- SQLRowStream
pipe() → {Pipe}
Pause this stream and return a to transfer the elements of this stream to a destination .
The stream will be resumed when the pipe will be wired to a
WriteStream.
- Source:
Returns:
a pipe
- Type
- Pipe
pipeTo(dst, handler)
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.
Parameters:
| Name | Type | Description |
|---|---|---|
dst |
WriteStream | the destination write stream |
handler |
function |
- Source:
resultSetClosedHandler(handler) → {SQLRowStream}
Event handler when a resultset is closed. This is useful to request for more results.
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function | called when the current result set is closed |
- Source:
Returns:
- Type
- SQLRowStream
resume() → {SQLRowStream}
- Source:
Returns:
- Type
- SQLRowStream