File tree 1 file changed +6
-0
lines changed
packages/pg-query-stream/src
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ class QueryStream extends Readable implements Submittable {
13
13
cursor : any
14
14
_result : any
15
15
16
+ callback : Function
16
17
handleRowDescription : Function
17
18
handleDataRow : Function
18
19
handlePortalSuspended : Function
@@ -26,6 +27,11 @@ class QueryStream extends Readable implements Submittable {
26
27
27
28
super ( { objectMode : true , autoDestroy : true , highWaterMark : batchSize || highWaterMark } )
28
29
this . cursor = new Cursor ( text , values , config )
30
+ this . cursor . on ( 'end' , ( result ) => {
31
+ this . callback && this . callback ( null , result )
32
+ } ) . on ( 'error' , ( err ) => {
33
+ this . callback && this . callback ( err )
34
+ } )
29
35
30
36
// delegate Submittable callbacks to cursor
31
37
this . handleRowDescription = this . cursor . handleRowDescription . bind ( this . cursor )
You can’t perform that action at this time.
0 commit comments