You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-21Lines changed: 45 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -617,37 +617,38 @@ await database.delete();
617
617
<aid="streaming-results"></a>
618
618
### Streaming results
619
619
620
-
The recommended way to consume query results is by using streams.
620
+
Streaming can only be used with a v2 connection and only using the execute stream method.
621
+
The streamResult method from normal the normal execute method returns an in-memory stream of result, rather than dynamically fetching them from the response.
621
622
622
-
For convenience, `statement.streamResult` also returns `meta: Promise<Meta[]>` and `statistics: Promise<Statistics>`, which are wrappers over `data.on('metadata')` and `data.on('statistics')`.
623
+
The recommended way to consume query results is by using streams with standard events:
In case an errors occurs before streaming, or during the first packet, the error will be thrown by the executeStream method. If the error occurs during streaming, it will be emitted by the stream.
650
+
651
+
```typescript
651
652
652
653
<aid="custom-stream-transformers"></a>
653
654
### Customstreamtransformers
@@ -679,22 +680,45 @@ const serializedStream = new SerializeRowStream()
0 commit comments