From 367e9d86be5180f81bd45c4fe2b75fd9acfcb9e8 Mon Sep 17 00:00:00 2001 From: Dan Prudhomme Date: Wed, 23 Jul 2025 12:47:42 -0500 Subject: [PATCH] ConnectionError now properly displays its message instead of [object Object], update msnodesqlv8/connection-pool.js - users can pass a connection driver to the connection configuration instead of having predefined values based on user platform. --- lib/error/connection-error.js | 1 + lib/msnodesqlv8/connection-pool.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/error/connection-error.js b/lib/error/connection-error.js index 5a259b04..8abdd784 100644 --- a/lib/error/connection-error.js +++ b/lib/error/connection-error.js @@ -18,6 +18,7 @@ class ConnectionError extends MSSQLError { super(message, code) this.name = 'ConnectionError' + this.message = message } } diff --git a/lib/msnodesqlv8/connection-pool.js b/lib/msnodesqlv8/connection-pool.js index 09b367f4..f7fd1a60 100644 --- a/lib/msnodesqlv8/connection-pool.js +++ b/lib/msnodesqlv8/connection-pool.js @@ -23,7 +23,7 @@ class ConnectionPool extends BaseConnectionPool { if (!this.config.connectionString) { cfg.conn_str = buildConnectionString({ - Driver: CONNECTION_DRIVER, + Driver: this.config.connectionDriver || CONNECTION_DRIVER, Server: this.config.options.instanceName ? `${this.config.server}\\${this.config.options.instanceName}` : `${this.config.server},${this.config.port}`, Database: this.config.database, Uid: this.config.user,