8

I get the error below. How do I fix it?

tedious deprecated The default value for `config.options.enableArithAbort` will change from `false` to `true` in the next major version of `tedious`. Set the value to `true` or `false` explicitly to silence this message. node_modules\mssql\lib\tedious\connection-pool.js:61:23

Pang
  • 9,564
  • 146
  • 81
  • 122
Math
  • 399
  • 1
  • 6
  • 14

4 Answers4

22

Change your database config options to the following:

     var config = {
      user: 'username',
      password: 'password',
      server: 'localhost', 
      database: 'databasename',
      "options": {
        "encrypt": true,
        "enableArithAbort": true
        }
   };

read issue details here: https://github.com/tediousjs/node-mssql/issues/976

MJ X
  • 8,506
  • 12
  • 74
  • 99
1

The following worked for me :

const config = {

    user: 'sa',

    password: '<YOUR_PASSWORD>',

    server: '<COMPUTER_NAME>\\SQLEXPRESS',

    database: '<DBNAME>',

    requestTimeout: 180000, // for timeout setting

    connectionTimeout: 180000, // for timeout setting

      "options": {

        "encrypt": false, // need to stop ssl checking in case of local db

        "enableArithAbort": true

        }
}
Luis Paulo Pinto
  • 5,578
  • 4
  • 21
  • 35
0

According to tedious docs and SET ARITHABORT

enableArithAbort: true // Ends a query when an overflow or divide-by-zero error occurs during query execution.  

encrypt: true, // A boolean determining whether or not the connection will be encrypted. Set to true if you're on Windows Azure.
Viraj Singh
  • 1,951
  • 1
  • 17
  • 27
-1

instead of setting in config in your project, set the value in node_modules node_modules/sequelize/lib/dialects/mssql/connection-manager.js.

options: {
   enableArithAbort: true,//<----------set this to true
   port: parseInt(config.port, 10),
   database: config.database,
   trustServerCertificate: true
}