(connection: Connection, databaseName: string, statement: string)
| 33 | }; |
| 34 | |
| 35 | const execute = async (connection: Connection, databaseName: string, statement: string): Promise<any> => { |
| 36 | const pool = await getMSSQLConnection(connection); |
| 37 | const request = pool.request(); |
| 38 | const result = await request.query(`USE ${databaseName}; ${statement}`); |
| 39 | await pool.close(); |
| 40 | |
| 41 | const executionResult: ExecutionResult = { |
| 42 | rawResult: result.recordset, |
| 43 | affectedRows: result.rowsAffected.length, |
| 44 | }; |
| 45 | return executionResult; |
| 46 | }; |
| 47 | |
| 48 | const getDatabases = async (connection: Connection): Promise<string[]> => { |
| 49 | const pool = await getMSSQLConnection(connection); |
no test coverage detected