@pi-r/mariadb 0.6.3 → 0.6.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/client/index.js +4 -1
- package/package.json +3 -3
package/client/index.js
CHANGED
|
@@ -23,8 +23,9 @@ class MariaDBPool extends DbPool {
|
|
|
23
23
|
}
|
|
24
24
|
const POOL_STATE = {};
|
|
25
25
|
const POOL_UNUSED = ['ssl', 'connectTimeout', 'socketTimeout', 'compress', 'keepAliveDelay', 'acquireTimeout', 'connectionLimit', 'idleTimeout', 'initializationTimeout', 'minDelayValidation', 'minimumIdle', 'resetAfterUse', 'noControlAfterUse', 'leakDetectionTimeout'];
|
|
26
|
+
const POOL_ACTIVE = new WeakSet();
|
|
26
27
|
function removePoolProperties(credential) {
|
|
27
|
-
if (!credential.uuidKey) {
|
|
28
|
+
if (!credential.uuidKey && POOL_ACTIVE.has(credential)) {
|
|
28
29
|
let result;
|
|
29
30
|
for (let i = 0, length = POOL_UNUSED.length; i < length; ++i) {
|
|
30
31
|
const attr = POOL_UNUSED[i];
|
|
@@ -190,6 +191,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
190
191
|
if (mariaDBPool) {
|
|
191
192
|
pools.push(client = await mariaDBPool.getConnection());
|
|
192
193
|
item.transactionState &= ~64 /* DB_TRANSACTION.AUTH */;
|
|
194
|
+
POOL_ACTIVE.add(credential);
|
|
193
195
|
return client;
|
|
194
196
|
}
|
|
195
197
|
const pool = item.usePool && DbPool.findKey(POOL_STATE, item.usePool, getPoolKey(credential), ...connectOnce ? [item, batch[0]] : [item]);
|
|
@@ -200,6 +202,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
200
202
|
mariaDBPool = pool;
|
|
201
203
|
}
|
|
202
204
|
pool.connected = true;
|
|
205
|
+
POOL_ACTIVE.add(credential);
|
|
203
206
|
}
|
|
204
207
|
catch (err) {
|
|
205
208
|
let close;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/mariadb",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "MariaDB 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.8.
|
|
25
|
-
"@e-mc/types": "^0.8.
|
|
24
|
+
"@e-mc/db": "^0.8.4",
|
|
25
|
+
"@e-mc/types": "^0.8.4",
|
|
26
26
|
"mariadb": "^3.2.3"
|
|
27
27
|
}
|
|
28
28
|
}
|