Skip to content

Commit

Permalink
feat: set enableArithAbort for SQLServerDriver (#7894)
Browse files Browse the repository at this point in the history
this prevents the deprecation message & also prevents us from
disabling `ARTITHABORT` which is the default on SQL Server
  • Loading branch information
imnotjames authored Jul 11, 2021
1 parent b0c1cc6 commit 1f64da2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/driver/sqlserver/SqlServerDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,21 @@ export class SqlServerDriver implements Driver {
}, options.extra || {});

// set default useUTC option if it hasn't been set
if (!connectionOptions.options) connectionOptions.options = { useUTC: false };
else if (!connectionOptions.options.useUTC) connectionOptions.options.useUTC = false;
if (!connectionOptions.options) {
connectionOptions.options = { useUTC: false };
} else if (!connectionOptions.options.useUTC) {
Object.assign(
connectionOptions.options,
{ useUTC: false }
)
}

// Match the next release of tedious for configuration options
// Also prevents warning messages.
Object.assign(
connectionOptions.options,
{ enableArithAbort: true }
)

// pooling is enabled either when its set explicitly to true,
// either when its not defined at all (e.g. enabled by default)
Expand Down

0 comments on commit 1f64da2

Please sign in to comment.