const Sequelize = require('sequelize')

const infra = {}

infra.database = (config, alias) => {
    let sequelize = new Sequelize(
        config.database[alias].database,
        config.database[alias].username,
        config.database[alias].password,
        config.database[alias].options
    )

    sequelize.instance = Sequelize
    return sequelize
}

module.exports = infra