feat: implement connection edit (#6)

This commit is contained in:
boojack
2023-03-29 11:54:45 +08:00
committed by GitHub
parent cc0e0b33ff
commit 6ac0ed45de
8 changed files with 189 additions and 178 deletions

View File

@ -13,18 +13,10 @@ const newPostgresClient = (connection: Connection) => {
};
const testConnection = async (connection: Connection): Promise<boolean> => {
if (!connection.database) {
return false;
}
try {
const client = newPostgresClient(connection);
await client.connect();
await client.end();
return true;
} catch (error) {
return false;
}
const client = newPostgresClient(connection);
await client.connect();
await client.end();
return true;
};
const execute = async (connection: Connection, _: string, statement: string): Promise<any> => {