'Sequelize dialect dependency on msnodesqlv8

We are using sequelize package to connect to mssql server. Our backend code is in javascript.

We have a working code like below:

const sequelize = new Sequelize({
  logging:log,
  dialect:'mssql',
  dialectModulePath: 'msnodesqlv8/lib/sequelize'
  dialectOptions:{
   connectionString: process.env.connectionString,
   encrypt: false
  },
  operatorAliases: false
})

Below is the format of connectionString we are using in above snippet:

Driver={ODBC Driver 17 for SQL Server}; Server=<<Servername>>;Database=<<Database>>;Trusted_Connection=yes;

And in package.json I can see below 3 packages:

"msnodesqlv8":"^2.4.7",
"sequelize":"^4.41.2",
"sequelize-msnodesqlv8":"^0.2.6-beta.8"

In official doc of sequelize, I can see

const sequelize = new Sequelize('database', 'username', 'password', {
  host: 'localhost',
  dialect:'mssql',
  operatorsAliases: false,

  pool: {
    max: 5,
    min: 0,
    acquire: 30000,
    idle: 10000
  },

  // SQLite only
  storage: 'path/to/database.sqlite'
});

There is no mention about msnodesqlv8. Right now connection is working fine. But I was just trying to understand if sequelize uses tedious under the hood in order to have appropriate drivers so that connection to DB can be made. Then what is the use of msnodesqlv8?

In msnodesqlv8 official docs I can see it has some enhanced security features.

What I am trying to achieve by understanding this?

I want to remove the dependency of my code from msnodesqlv8 and snippet provided in official document of sequelize for mssql is not working for me.

Reason for removing dependency of msnodesqlv8?

We are migrating code to linux and msnodesqlv8 is compatible with linux which has dependency on msodbcsql17 driver which needs to be installed separately.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source