index.js 551 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { Sequelize } from "sequelize";
import UserModel from "../models/user.model.js";
import dbConfig from "../config/db.config.js";

const sequelize = new Sequelize(
  String(dbConfig.database),
  String(dbConfig.username),
  dbConfig.password,
  {
    host: dbConfig.host,
    dialect: dbConfig.dialect,
    // pool: {
    //   max: dbConfig.pool?.max,
    //   min: dbConfig.pool?.min,
    //   acquire: dbConfig.pool?.acquire,
    //   idle: dbConfig.pool?.idle,
    // },
  }
);

const User = UserModel(sequelize);

export { sequelize, User };