File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -333,6 +333,7 @@ function Postgres(a, b) {
333333 }
334334 fn . rows = rows
335335 query . cursor = fn
336+ query . simple = false
336337 return promise
337338 }
338339 }
Original file line number Diff line number Diff line change @@ -948,6 +948,16 @@ t('Cursor works', async() => {
948948 return [ '1a1b2a2b' , order . join ( '' ) ]
949949} )
950950
951+ t ( 'Unsafe cursor works' , async ( ) => {
952+ const order = [ ]
953+ await sql . unsafe ( 'select 1 as x union select 2 as x' ) . cursor ( async ( x ) => {
954+ order . push ( x . x + 'a' )
955+ await delay ( 100 )
956+ order . push ( x . x + 'b' )
957+ } )
958+ return [ '1a1b2a2b' , order . join ( '' ) ]
959+ } )
960+
951961t ( 'Cursor custom n works' , async ( ) => {
952962 const order = [ ]
953963 await sql `select * from generate_series(1,20)` . cursor ( 10 , async ( x ) => {
You can’t perform that action at this time.
0 commit comments