@pi-r/mysql 0.5.3 → 0.5.4
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/LICENSE +1 -1
- package/client/index.js +6 -5
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright
|
|
1
|
+
Copyright 2024 An Pham
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
package/client/index.js
CHANGED
|
@@ -74,6 +74,7 @@ function setAuthentication(credential) {
|
|
|
74
74
|
}
|
|
75
75
|
exports.setAuthentication = setAuthentication;
|
|
76
76
|
function setCredential(item) {
|
|
77
|
+
var _a, _b, _c, _d, _e;
|
|
77
78
|
let credential = this.getCredential(item);
|
|
78
79
|
if (credential) {
|
|
79
80
|
setAuthentication.call(this, credential);
|
|
@@ -97,7 +98,7 @@ function setCredential(item) {
|
|
|
97
98
|
const usePool = item.usePool;
|
|
98
99
|
if (usePool) {
|
|
99
100
|
let username, password, pool;
|
|
100
|
-
if (typeof usePool === 'string' && (username = credential.user || credential.uri && (0, util_1.parseConnectionString)(credential.uri)
|
|
101
|
+
if (typeof usePool === 'string' && (username = credential.user || credential.uri && ((_a = (0, util_1.parseConnectionString)(credential.uri)) === null || _a === void 0 ? void 0 : _a.username))) {
|
|
101
102
|
[password, pool] = DbPool.validateKey(POOL_STATE, username, usePool);
|
|
102
103
|
if (pool) {
|
|
103
104
|
pool.add(item, password);
|
|
@@ -110,16 +111,16 @@ function setCredential(item) {
|
|
|
110
111
|
if (config) {
|
|
111
112
|
const { max, idle, queue_max, timeout } = config;
|
|
112
113
|
if (max > 0) {
|
|
113
|
-
credential.connectionLimit
|
|
114
|
+
(_b = credential.connectionLimit) !== null && _b !== void 0 ? _b : (credential.connectionLimit = max);
|
|
114
115
|
}
|
|
115
116
|
if (idle >= 0) {
|
|
116
|
-
credential.idleTimeout
|
|
117
|
+
(_c = credential.idleTimeout) !== null && _c !== void 0 ? _c : (credential.idleTimeout = idle);
|
|
117
118
|
}
|
|
118
119
|
if (queue_max >= 0) {
|
|
119
|
-
credential.queueLimit
|
|
120
|
+
(_d = credential.queueLimit) !== null && _d !== void 0 ? _d : (credential.queueLimit = queue_max);
|
|
120
121
|
}
|
|
121
122
|
if (timeout > 0) {
|
|
122
|
-
credential.connectTimeout
|
|
123
|
+
(_e = credential.connectTimeout) !== null && _e !== void 0 ? _e : (credential.connectTimeout = timeout);
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
126
|
new MySQLPool(mysql.createPool(removeUUIDKey(credential)), poolKey, username && password ? { username, password } : undefined).add(item).parent = POOL_STATE;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/mysql",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "MySQL client driver for E-mc.",
|
|
5
5
|
"main": "client/index.js",
|
|
6
6
|
"types": "client/index.d.ts",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@e-mc/db": "^0.7.
|
|
25
|
-
"@e-mc/types": "^0.7.
|
|
24
|
+
"@e-mc/db": "^0.7.5",
|
|
25
|
+
"@e-mc/types": "^0.7.5",
|
|
26
26
|
"mysql2": "^3.9.3"
|
|
27
27
|
}
|
|
28
28
|
}
|