mssql 12.1.1 → 12.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -95,7 +95,7 @@ const config = {
95
95
  trustedConnection: true, // Set to true if using Windows Authentication
96
96
  trustServerCertificate: true, // Set to true if using self-signed certificates
97
97
  },
98
- driver: "msnodesqlv8", // Required if using Windows Authentication
98
+ // driver: "ODBC Driver 18 for SQL Server", // Uncomment to use specific driver
99
99
  };
100
100
 
101
101
  (async () => {
@@ -9,7 +9,7 @@ const ConnectionError = require('../error/connection-error')
9
9
  const { platform } = require('node:os')
10
10
  const { buildConnectionString } = require('@tediousjs/connection-string')
11
11
 
12
- const CONNECTION_DRIVER = ['darwin', 'linux'].includes(platform()) ? 'ODBC Driver 17 for SQL Server' : 'SQL Server Native Client 11.0'
12
+ const DEFAULT_CONNECTION_DRIVER = ['darwin', 'linux'].includes(platform()) ? 'ODBC Driver 17 for SQL Server' : 'SQL Server Native Client 11.0'
13
13
 
14
14
  class ConnectionPool extends BaseConnectionPool {
15
15
  _poolCreate () {
@@ -23,7 +23,7 @@ class ConnectionPool extends BaseConnectionPool {
23
23
 
24
24
  if (!this.config.connectionString) {
25
25
  cfg.conn_str = buildConnectionString({
26
- Driver: CONNECTION_DRIVER,
26
+ Driver: this.config.driver && this.config.driver !== 'msnodesqlv8' ? this.config.driver : DEFAULT_CONNECTION_DRIVER,
27
27
  Server: this.config.options.instanceName ? `${this.config.server}\\${this.config.options.instanceName}` : `${this.config.server},${this.config.port}`,
28
28
  Database: this.config.database,
29
29
  Uid: this.config.user,
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "azure",
22
22
  "node-mssql"
23
23
  ],
24
- "version": "12.1.1",
24
+ "version": "12.2.0",
25
25
  "main": "index.js",
26
26
  "type": "commonjs",
27
27
  "repository": {