Skip to content

Commit 9a3bc94

Browse files
committed
More queryStream doc
1 parent 00cb1f9 commit 9a3bc94

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

doc/api.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -750,10 +750,9 @@ oracledb.stmtCacheSize = 30;
750750
#### <a name="propdbstreamnumrows"></a> 3.2.17 streamNumRows
751751

752752
A value used when streaming rows with [`queryStream()`](#querystream).
753-
It does not limit the total number of rows returned by the stream.
754-
The value is passed to internal [getRows()](#getrows) calls and is
755-
used only for tuning because `getRows()` may be internally called one
756-
or more times when streaming results.
753+
It does not limit the total number of rows returned by the stream or
754+
the `data` events generated. The value is passed to internal
755+
[getRows()](#getrows) calls and is used only for tuning.
757756

758757
The default value is 100.
759758

@@ -1434,20 +1433,28 @@ stream.Readable queryStream(String sql, [Object bindParams, [Object options]]);
14341433

14351434
##### Return Value
14361435

1437-
This function will return a readable stream for queries.
1436+
This function will return a
1437+
[Readable Stream](https://nodejs.org/api/stream.html) for queries.
14381438

14391439
##### Description
14401440

1441-
This function provides query streaming support. The input of this
1442-
function is same as `execute()` however a callback is not used.
1443-
Instead this function returns a stream used to fetch data. See
1444-
[Streaming Results](#streamingresults) for more information.
1441+
This function provides query streaming support. The parameters are
1442+
the same as [`execute()`](#execute) except a callback is not used.
1443+
Instead this function returns a stream used to fetch data.
1444+
1445+
Each row is returned as a `data` event. Query metadata is available
1446+
via a `metadata` event. The `end` event indicates the end of the
1447+
query results.
1448+
1449+
Query results must be fetched to completion to avoid resource leaks.
14451450

14461451
The connection must remain open until the stream is completely read.
14471452

1453+
See [Streaming Query Results](#streamingresults) for more information.
1454+
14481455
##### Parameters
14491456

1450-
See [connection.execute()](#execute).
1457+
See [execute()](#execute).
14511458

14521459
An additional options attribute `streamNumRows` can be set. This
14531460
overrides *Oracledb* [`streamNumRows`](#propdbstreamnumrows).
@@ -2436,7 +2443,8 @@ specified by the [`oracledb.streamNumRows`](#propdbstreamnumrows)
24362443
value or the `queryStream()` option attribute `streamNumRows`. This
24372444
value does not alter the number of rows returned by the stream since
24382445
`getRows()` will be called each time more rows are needed. However
2439-
the value can be used to tune performance.
2446+
the value can be used to tune performance, as also can the value of
2447+
[`prefetchRows`](#propdbprefetchrows).
24402448
24412449
There is no explicit ResultSet `close()` call for streaming query
24422450
results. This call will be executed internally when all data has been
@@ -3014,7 +3022,7 @@ Lob switches to flowing mode.
30143022
For unpiped Readable Lobs operating in flowing mode where the Lob is
30153023
read through event handlers, the Lob object can be switched to paused
30163024
mode by calling `pause()`. Once the Lob is in paused mode, it stops
3017-
emitting 'data' events.
3025+
emitting `data` events.
30183026
30193027
Similarly, a Readable Lob operating in the paused mode can be switched
30203028
to flowing mode by calling `resume()`. It will then start emitting

0 commit comments

Comments
 (0)