import dotenv from "dotenv";
dotenv.config();
import mysql from "mysql2/promise";
import fs from "fs"
const host = process.env.DB_HOST;
const user = process.env.DB_USER;
const password = process.env.DB_PASSWORD;
const database = process.env.DATABASE;


const connection = mysql.createPool({
    host: host,
    user: user,
    password: password,
    database: database,
    multipleStatements: true
})

// const connectDb = async() => {
//     try {
//         await connection.query("USE faisar_hospital;");
//         console.log("Connected to database");
//     } catch (error) {
//         console.log(error);
//     }
// }


export { connection };