15 lines
302 B
TypeScript
15 lines
302 B
TypeScript
|
import mysql from "mysql";
|
||
|
|
||
|
/**
|
||
|
* # End MYSQL Connection
|
||
|
*/
|
||
|
function endConnection(connection: mysql.Connection) {
|
||
|
if (connection.state !== "disconnected") {
|
||
|
connection.end((err) => {
|
||
|
console.log(err?.message);
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default endConnection;
|