const { Sequelize } = require("sequelize");
const dotenv = require("dotenv");

dotenv.config();

const sequelize = new Sequelize({
  dialect: "mssql",
  host: process.env.DB_SERVER,
  username: process.env.DB_USER,
  password: process.env.DB_PASSWORD,
  database: process.env.DB_NAME,
  port: process.env.DB_PORT,
  dialectOptions: {
    instanceName: "MSSQL22",
    encrypt: true,
    trustServerCertificate: true,
  },
  pool: {
    min: 2,
    max: 10,
  },
  define: {
    timestamps: false,
  },
});

module.exports = sequelize;
