It should works as intended but in typescript I can't access this property, because it doesn't exist in the package @types/mssql
"dependencies": {
...
"mssql": "^6.2.0",
...
},
"devDependencies": {
...
"@types/mssql": "^6.0.3",
...
}
TSError: ⨯ Unable to compile TypeScript:
src/config/db.ts(366,35): error TS2339: Property 'healthy' does not exist on type 'ConnectionPool'
Then that package will need updating
Sorry I thought you guys also maintained that package. My bad.
Sorry I thought you guys also maintained that package. My bad.
You can add some type declartion in the node_modules/@types/mssql like this.
@types/mssql/index.d.ts
export declare function query(command: TemplateStringsArray, ...interpolations: any[]): Promise<IResult<any>>;
export declare function connect(config: config | string, callback?: (err: any) => void): Promise<ConnectionPool>;
export declare function close(callback?: (err: any) => void): void;
Please refer to the node-mssql/lib/global-connection.js →
Most helpful comment
You can add some type declartion in the node_modules/@types/mssql like this.
@types/mssql/index.d.tsPlease refer to the node-mssql/lib/global-connection.js →