const mysql = require("mysql2");

const pool = mysql.createPool({
  host: "85.215.63.122",
  user: "praxisuser",
  password: "praxisuser",
  database: "praxissoftware",
  waitForConnections: true,
  connectionLimit: 10,
  queueLimit: 0
});

// Optionaler Test beim Start
pool.getConnection((err, connection) => {
  if (err) {
    console.error("❌ MySQL Pool Fehler:", err);
    process.exit(1);
  }
  console.log("✅ MySQL Pool verbunden");
  connection.release();
});

module.exports = pool;

