(connection: Connection)
| 69 | }; |
| 70 | |
| 71 | const getDatabases = async (connection: Connection): Promise<string[]> => { |
| 72 | const conn = await getMySQLConnection(connection); |
| 73 | const [rows] = await conn.query<RowDataPacket[]>( |
| 74 | `SELECT schema_name as db_name FROM information_schema.schemata WHERE schema_name NOT IN (?);`, |
| 75 | [systemDatabases] |
| 76 | ); |
| 77 | conn.destroy(); |
| 78 | const databaseList = []; |
| 79 | for (const row of rows) { |
| 80 | if (row["db_name"]) { |
| 81 | databaseList.push(row["db_name"]); |
| 82 | } |
| 83 | } |
| 84 | return databaseList; |
| 85 | }; |
| 86 | |
| 87 | const getTableSchema = async (connection: Connection, databaseName: string): Promise<Schema[]> => { |
| 88 | const conn = await getMySQLConnection(connection); |
no test coverage detected