From 3e4a4042070f1e48cd878c11d9e73256829d0a1c Mon Sep 17 00:00:00 2001 From: Dan Hensby Date: Sun, 8 Jun 2025 14:56:58 +0100 Subject: [PATCH] chore(deps): upgrade @tediousjs/connection-string to v1.0.0 --- lib/base/connection-pool.js | 4 ++-- lib/msnodesqlv8/connection-pool.js | 4 ++-- package-lock.json | 14 +++++++------- package.json | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/base/connection-pool.js b/lib/base/connection-pool.js index 6888aa25..2ee8b672 100644 --- a/lib/base/connection-pool.js +++ b/lib/base/connection-pool.js @@ -2,7 +2,7 @@ const { EventEmitter } = require('node:events') const debug = require('debug')('mssql:base') -const { parseSqlConnectionString } = require('@tediousjs/connection-string') +const { parse, MSSQL_SCHEMA } = require('@tediousjs/connection-string') const tarn = require('tarn') const { IDS } = require('../utils') const ConnectionError = require('../error/connection-error') @@ -122,7 +122,7 @@ class ConnectionPool extends EventEmitter { } static _parseConnectionString (connectionString) { - const parsed = parseSqlConnectionString(connectionString, true, true) + const parsed = parse(connectionString).toSchema(MSSQL_SCHEMA, { includeMissing: true }) return Object.entries(parsed).reduce((config, [key, value]) => { switch (key) { case 'application name': diff --git a/lib/msnodesqlv8/connection-pool.js b/lib/msnodesqlv8/connection-pool.js index 09b367f4..d7ff771f 100644 --- a/lib/msnodesqlv8/connection-pool.js +++ b/lib/msnodesqlv8/connection-pool.js @@ -7,7 +7,7 @@ const { IDS, INCREMENT } = require('../utils') const shared = require('../shared') const ConnectionError = require('../error/connection-error') const { platform } = require('node:os') -const { buildConnectionString } = require('@tediousjs/connection-string') +const { build } = require('@tediousjs/connection-string') const CONNECTION_DRIVER = ['darwin', 'linux'].includes(platform()) ? 'ODBC Driver 17 for SQL Server' : 'SQL Server Native Client 11.0' @@ -22,7 +22,7 @@ class ConnectionPool extends BaseConnectionPool { } if (!this.config.connectionString) { - cfg.conn_str = buildConnectionString({ + cfg.conn_str = build({ Driver: CONNECTION_DRIVER, Server: this.config.options.instanceName ? `${this.config.server}\\${this.config.options.instanceName}` : `${this.config.server},${this.config.port}`, Database: this.config.database, diff --git a/package-lock.json b/package-lock.json index 295f9173..66da755c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "9.1.1", "license": "MIT", "dependencies": { - "@tediousjs/connection-string": "^0.6.0", + "@tediousjs/connection-string": "^1.0.0", "commander": "^11.0.0", "debug": "^4.3.3", "rfdc": "^1.3.0", @@ -1561,9 +1561,9 @@ } }, "node_modules/@tediousjs/connection-string": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@tediousjs/connection-string/-/connection-string-0.6.0.tgz", - "integrity": "sha512-GxlsW354Vi6QqbUgdPyQVcQjI7cZBdGV5vOYVYuCVDTylx2wl3WHR2HlhcxxHTrMigbelpXsdcZso+66uxPfow==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@tediousjs/connection-string/-/connection-string-1.0.0.tgz", + "integrity": "sha512-3G0JqbtokS8h9Wz4JfcOVhaI9Thknv2PP2+mE33jMdH4lUQMBfLZas4R0kVEvwNC0QsPUbGF6H36oBou1bxdkg==" }, "node_modules/@tootallnate/once": { "version": "2.0.0", @@ -12021,9 +12021,9 @@ "dev": true }, "@tediousjs/connection-string": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@tediousjs/connection-string/-/connection-string-0.6.0.tgz", - "integrity": "sha512-GxlsW354Vi6QqbUgdPyQVcQjI7cZBdGV5vOYVYuCVDTylx2wl3WHR2HlhcxxHTrMigbelpXsdcZso+66uxPfow==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@tediousjs/connection-string/-/connection-string-1.0.0.tgz", + "integrity": "sha512-3G0JqbtokS8h9Wz4JfcOVhaI9Thknv2PP2+mE33jMdH4lUQMBfLZas4R0kVEvwNC0QsPUbGF6H36oBou1bxdkg==" }, "@tootallnate/once": { "version": "2.0.0", diff --git a/package.json b/package.json index f41e85f9..dba8325a 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ }, "license": "MIT", "dependencies": { - "@tediousjs/connection-string": "^0.6.0", + "@tediousjs/connection-string": "^1.0.0", "commander": "^11.0.0", "debug": "^4.3.3", "rfdc": "^1.3.0",