File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import { createLogger } from '@sqltools/log';
1717import path from 'path' ;
1818import fs from 'fs' ;
1919import { URI } from 'vscode-uri' ;
20- import { createTunnel } from 'tunnel-ssh' ;
20+ import { createTunnel , TunnelOptions } from 'tunnel-ssh' ;
2121import { AddressInfo } from 'net' ;
2222
2323export default abstract class AbstractDriver < ConnectionType extends any , DriverOptions extends any > implements IConnectionDriver {
@@ -142,12 +142,14 @@ export default abstract class AbstractDriver<ConnectionType extends any, DriverO
142142 db : {
143143 host : string ;
144144 port : number ;
145- }
145+ } ,
146+ tunnelOptions ?: Partial < TunnelOptions >
146147 ) {
147148 const [ sshTunnel ] = await createTunnel (
148149 {
149150 autoClose : true ,
150151 reconnectOnError : false ,
152+ ...tunnelOptions ,
151153 } ,
152154 null ,
153155 {
@@ -164,6 +166,9 @@ export default abstract class AbstractDriver<ConnectionType extends any, DriverO
164166 ) ;
165167 return {
166168 port : ( sshTunnel . address ( ) as AddressInfo ) . port ,
169+ close : ( ) => {
170+ sshTunnel . close ( ) ;
171+ } ,
167172 } ;
168173 }
169174
You can’t perform that action at this time.
0 commit comments