(conn: MssqlConnection, sql: string)
| 71 | } |
| 72 | |
| 73 | function mssqlQuery(conn: MssqlConnection, sql: string): Promise<any[][]> { |
| 74 | return new Promise((resolve, reject) => { |
| 75 | const req = new MssqlRequest(sql, (err, _rc, rows) => (err ? reject(err) : resolve(rows ?? []))); |
| 76 | conn.execSql(req); |
| 77 | }); |
| 78 | } |
| 79 | |
| 80 | async function withMssql<T>(port: number, fn: (c: MssqlConnection) => Promise<T>): Promise<T> { |
| 81 | const conn = await mssqlConnect(port); |
no test coverage detected