mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-08-02 22:58:43 +08:00
feat: implement connection edit (#6)
This commit is contained in:
@ -11,13 +11,9 @@ const convertToConnectionUrl = (connection: Connection): string => {
|
||||
|
||||
const testConnection = async (connection: Connection): Promise<boolean> => {
|
||||
const connectionUrl = convertToConnectionUrl(connection);
|
||||
try {
|
||||
const conn = await mysql.createConnection(connectionUrl);
|
||||
conn.destroy();
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
const conn = await mysql.createConnection(connectionUrl);
|
||||
conn.destroy();
|
||||
return true;
|
||||
};
|
||||
|
||||
const execute = async (connection: Connection, databaseName: string, statement: string): Promise<any> => {
|
||||
|
Reference in New Issue
Block a user