File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -162,11 +162,11 @@ Use cursors if you need to throttle the amount of rows being returned from a que
162
162
163
163
``` js
164
164
165
- await sql . cursor `
165
+ await sql `
166
166
select * from generate_series(1 ,4 ) as x
167
- ` .cursor (row => {
167
+ ` .cursor (async row => {
168
168
// row = { x: 1 }
169
- http .request (' https://example.com/wat' , { row })
169
+ await http .request (' https://example.com/wat' , { row })
170
170
})
171
171
172
172
// No more rows
@@ -177,9 +177,9 @@ A single row will be returned by default, but you can also request batches by se
177
177
178
178
``` js
179
179
180
- await sql . cursor `
180
+ await sql `
181
181
select * from generate_series(1 ,1000 ) as x
182
- ` .cursor (10 , rows => {
182
+ ` .cursor (10 , async rows => {
183
183
// rows = [{ x: 1 }, { x: 2 }, ... ]
184
184
await Promise .all (rows .map (row =>
185
185
http .request (' https://example.com/wat' , { row })
@@ -194,7 +194,7 @@ You can also stop receiving any more rows early by returning an end token `sql.E
194
194
195
195
``` js
196
196
197
- await sql . cursor `
197
+ await sql `
198
198
select * from generate_series(1 ,1000 ) as x
199
199
` .cursor (row => {
200
200
return Math .random () > 0.9 && sql .END
You can’t perform that action at this time.
0 commit comments