@pi-r/mssql 0.9.3 → 0.10.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/client/index.js +6 -5
- package/package.json +4 -4
package/client/index.js
CHANGED
|
@@ -113,7 +113,6 @@ function setCredential(item) {
|
|
|
113
113
|
}
|
|
114
114
|
const auth = credential.authentication ||= { options: {} };
|
|
115
115
|
const authOptions = auth.options ||= {};
|
|
116
|
-
auth.type ||= 'default';
|
|
117
116
|
if (database || port) {
|
|
118
117
|
const options = credential.options ||= {};
|
|
119
118
|
options.database ||= database;
|
|
@@ -122,7 +121,7 @@ function setCredential(item) {
|
|
|
122
121
|
}
|
|
123
122
|
}
|
|
124
123
|
let flags = 0;
|
|
125
|
-
switch (auth.type) {
|
|
124
|
+
switch (auth.type ||= 'default') {
|
|
126
125
|
case 'default':
|
|
127
126
|
flags = 1;
|
|
128
127
|
break;
|
|
@@ -180,7 +179,7 @@ function setCredential(item) {
|
|
|
180
179
|
errors.push('authentication.options.msiEndpoint');
|
|
181
180
|
}
|
|
182
181
|
if (errors.length > 0) {
|
|
183
|
-
throw (0, types_1.errorMessage)("mssql",
|
|
182
|
+
throw (0, types_1.errorMessage)("mssql", "Invalid credentials", errors.join(', '));
|
|
184
183
|
}
|
|
185
184
|
const options = credential.options;
|
|
186
185
|
if (options) {
|
|
@@ -204,7 +203,8 @@ function setCredential(item) {
|
|
|
204
203
|
let pool;
|
|
205
204
|
password = undefined;
|
|
206
205
|
if ((0, types_1.isString)(usePool)) {
|
|
207
|
-
|
|
206
|
+
username = authOptions.userName;
|
|
207
|
+
if (username) {
|
|
208
208
|
[password, pool] = DbPool.validateKey(POOL_STATE, username, usePool);
|
|
209
209
|
if (pool) {
|
|
210
210
|
pool.add(item, password);
|
|
@@ -446,7 +446,8 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
446
446
|
rows.push(...items);
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
catch {
|
|
449
|
+
catch (err) {
|
|
450
|
+
error ||= err;
|
|
450
451
|
}
|
|
451
452
|
return;
|
|
452
453
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/mssql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "MSSQL client driver for E-mc.",
|
|
5
5
|
"main": "client/index.js",
|
|
6
6
|
"types": "client/index.d.ts",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/db": "^0.
|
|
24
|
-
"@e-mc/types": "^0.
|
|
25
|
-
"tedious": "^18.6.
|
|
23
|
+
"@e-mc/db": "^0.12.0",
|
|
24
|
+
"@e-mc/types": "^0.12.0",
|
|
25
|
+
"tedious": "^18.6.1",
|
|
26
26
|
"tedious-connection-pool2": "^2.1.0"
|
|
27
27
|
}
|
|
28
28
|
}
|