You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
829 B

const sequelize = require("sequelize")
var reconnectOptions = {
max_retries: 999,
onRetry: function (count) {
console.log("connection lost, trying to connect (" + count + ")");
}
}
const db = new sequelize("TDDB", "sa", "TD@dmin168", {
host: "192.168.1.100",
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;