File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ export class DuckDBConnection {
28
28
}
29
29
/** Same as disconnectSync. */
30
30
public closeSync ( ) {
31
- return this . disconnectSync ( ) ;
31
+ this . disconnectSync ( ) ;
32
32
}
33
33
public disconnectSync ( ) {
34
34
this . preparedStatements . destroySync ( ) ;
35
- return duckdb . disconnect_sync ( this . connection ) ;
35
+ duckdb . disconnect_sync ( this . connection ) ;
36
36
}
37
37
public interrupt ( ) {
38
38
duckdb . interrupt ( this . connection ) ;
@@ -49,7 +49,8 @@ export class DuckDBConnection {
49
49
const prepared = await this . createPrepared ( sql ) ;
50
50
try {
51
51
prepared . bind ( values , types ) ;
52
- return prepared . run ( ) ;
52
+ const result = await prepared . run ( ) ;
53
+ return result ;
53
54
} finally {
54
55
prepared . destroySync ( ) ;
55
56
}
@@ -95,7 +96,8 @@ export class DuckDBConnection {
95
96
if ( values ) {
96
97
prepared . bind ( values , types ) ;
97
98
}
98
- return prepared . stream ( ) ;
99
+ const result = await prepared . stream ( ) ;
100
+ return result ;
99
101
} finally {
100
102
prepared . destroySync ( ) ;
101
103
}
Original file line number Diff line number Diff line change @@ -785,6 +785,13 @@ describe('api', () => {
785
785
) ;
786
786
} ) ;
787
787
} ) ;
788
+ test ( 'runAndReadAll with params' , async ( ) => {
789
+ await withConnection ( async ( connection ) => {
790
+ const reader = await connection . runAndReadAll ( 'select ? as n' , [ 17 ] ) ;
791
+ const rows = reader . getRowObjects ( ) ;
792
+ assert . deepEqual ( rows , [ { n : 17 } ] ) ;
793
+ } ) ;
794
+ } ) ;
788
795
test ( 'should support all data types' , async ( ) => {
789
796
await withConnection ( async ( connection ) => {
790
797
const result = await connection . run (
You can’t perform that action at this time.
0 commit comments