datasquirel/package-shared/utils/endConnection.ts

15 lines
304 B
TypeScript
Raw Normal View History

2025-01-10 19:10:28 +00:00
import mysql from "mysql";
2023-09-21 14:00:04 +00:00
/**
2025-01-10 19:10:28 +00:00
* # End MYSQL Connection
2023-09-21 14:00:04 +00:00
*/
2025-01-10 19:10:28 +00:00
function endConnection(connection: mysql.Connection) {
2023-09-21 14:00:04 +00:00
if (connection.state !== "disconnected") {
connection.end((err) => {
console.log(err?.message);
});
}
}
module.exports = endConnection;