Ajout initial des fichiers de la version mysal

This commit is contained in:
Rampeur
2025-08-08 18:34:15 +02:00
parent 29635cdf83
commit 9a534d5a17
30 changed files with 1381 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
const { Sequelize } = require('sequelize');
const Op = Sequelize.Op;
const sequelize = new Sequelize(
process.env.MYSQL_DBNAME,
process.env.MYSQL_DBUSER,
process.env.MYSQL_DBPASS,
{
host: process.env.MYSQL_DBHOST,
port: process.env.MYSQL_DBPORT,
dialect: process.env.MYSQL_DBTYPE,
$like: Op.like,
$not: Op.not
}
);
const checkConnection = async () => {
try {
await sequelize.authenticate();
console.log(`DB Connected`.cyan.underline.bold);
} catch (error) {
console.error("Unable to connect to the database:".red.bold, error);
}
};
checkConnection();
module.exports = sequelize;