(connection: Connection)
| 46 | }; |
| 47 | |
| 48 | const getDatabases = async (connection: Connection): Promise<string[]> => { |
| 49 | const pool = await getMSSQLConnection(connection); |
| 50 | const request = pool.request(); |
| 51 | const result = await request.query(`SELECT name FROM sys.databases WHERE name NOT IN ('${systemDatabases.join("','")}');`); |
| 52 | await pool.close(); |
| 53 | const databaseList = []; |
| 54 | for (const row of result.recordset) { |
| 55 | if (row["name"]) { |
| 56 | databaseList.push(row["name"]); |
| 57 | } |
| 58 | } |
| 59 | return databaseList; |
| 60 | }; |
| 61 | |
| 62 | const getTableSchema = async (connection: Connection, databaseName: string): Promise<Schema[]> => { |
| 63 | const pool = await getMSSQLConnection(connection); |
no test coverage detected