File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
api/pkgs/@duckdb/node-api Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,36 @@ for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {
146
146
}
147
147
```
148
148
149
+ ### Result Reader
150
+
151
+ Run and read all data:
152
+ ``` ts
153
+ const reader = await connection .runAndReadAll (' from test_all_types()' );
154
+ const rows = reader .getRows ();
155
+ // OR: const columns = reader.getColumns();
156
+ ```
157
+
158
+ Run and read up to (at lesat) some number of rows:
159
+ ``` ts
160
+ const reader = await connection .runAndReadUtil (' from range(5000)' , 1000 );
161
+ const rows = reader .getRows ();
162
+ // rows.length === 2048. (Rows are read in chunks of 2048.)
163
+ ```
164
+
165
+ Read rows incrementally:
166
+ ``` ts
167
+ const reader = await connection .runAndRead (' from range(5000)' );
168
+ reader .readUntil (2000 );
169
+ // reader.currentRowCount === 2048 (Rows are read in chunks of 2048.)
170
+ // reader.done === false
171
+ reader .readUntil (4000 );
172
+ // reader.currentRowCount === 4096
173
+ // reader.done === false
174
+ reader .readUntil (6000 );
175
+ // reader.currentRowCount === 5000
176
+ // reader.done === true
177
+ ```
178
+
149
179
### Inspect Data Types
150
180
151
181
``` ts
You can’t perform that action at this time.
0 commit comments