const sequelize = require("sequelize") var reconnectOptions = { max_retries: 999, onRetry: function (count) { console.log("connection lost, trying to connect (" + count + ")"); } } // const local_db = "TD@admin168" const prod_db = "T0n@d!g!t@l2023" const db = new sequelize("TDDB", "sa", prod_db, { host: "51.79.251.248", port: 1433, dialect: "mssql", dialectOptions: { options: { // instanceName: "BCDB", trustServerCertificate: true, requestTimeout: 500000 } }, autoreconnect: true, reconnect: reconnectOptions, pool: { max: 10, min: 0, idleTimeoutMillis: 0, requestTimeout: 0 }, }) db.authenticate() .then(() => console.log("Database Connected...")) .catch((err) => console.log("Cannot connect to database " + err)); module.exports = db;