dyno-bot/backend-master/config/db.js
2020-09-12 19:08:48 +01:00

20 lines
427 B
JavaScript

const Sequelize = require('sequelize');
const config = require('./config');
function getDbInstance() {
const sequelize = new Sequelize(Object.assign({
operatorsAliases: false,
logging: false
}, config.db));
sequelize.authenticate()
.then(() => console.log('Database connection successful'))
.catch(error => console.error('Database auth error:', error));
return sequelize;
}
module.exports = {
getDbInstance
};