Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/base/connection-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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':
Expand Down
4 changes: 2 additions & 2 deletions lib/msnodesqlv8/connection-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading