question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to pass `enableArithAbort` to Tedious?

See original GitHub issue

Expected behaviour:

I would like to pass the “enableArithAbort” config option value to Tedious, it makes a lot of difference in my case: the query takes 1 second when it’s on, 1+ minute when it’s off.

Actual behaviour:

I tried the following:

await this.sqlClient.connect({
       ...
        "enableArithAbort": true
      });

But it doesn’t work, enableArithAbort seems to be absent from the config object when it’s checked.

If I manually edit connection.js like this:

    if (true) {
      options.push('set arithabort on');
    } else if (this.config.options.enableArithAbort === false) {
      options.push('set arithabort off');
    }

The option is set correctly and the performance goes through the roof.

Configuration:

Not sure what to put that’s relevant here.

Software versions

$ node --version
v10.15.1

mssql@^5.1.0:
  version "5.1.0"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13

github_iconTop GitHub Comments

5reactions
deregtdcommented, May 10, 2020

This is kinda an issue:

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. webpack:\node_modules\mssql\lib\tedious\connection-pool.js?, <anonymous>:61:23

For those of us trying to use this module on azure, a big ol warning stuffed into our logs every startup is not … thrilling. 😃

4reactions
ggb88commented, Mar 9, 2020

this worked for me

mdPool = new sql.ConnectionPool({
            user: 'sa',
            password: '********',
            server: 'localhost',
            port: 32768,
            database: 'UnityMD',
            options: {
                "enableArithAbort": true
            }
        });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js mssql error: tedious deprecated The ... - Stack Overflow
How do I fix it? tedious deprecated The default value for `config.options.enableArithAbort` will change from `false` to `true` in the next major ...
Read more >
API - Connection | Tedious
Tedious supports an authentication type: azure-active-directory-password . ... enableArithAbort: Ends a query when an overflow or divide-by-zero error ...
Read more >
Nodejs mssql tedious deprecated message v3.9.7
tedious deprecated The default value for config.options.enableArithAbort will change from false to true in the next major version of tedious ...
Read more >
Creating an Express API using SQL Server - Jamie Phillips
I initially thought I needed to use tedious, which turned out to ... We will call the connect method passing in the configuration...
Read more >
Tedious Promise - Google Groups
I am new with node js. i am using tedious promise to connect with my sql server. i am connected successfully, My question...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found