@pi-r/oracle 0.3.3 → 0.3.5
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 +8 -6
- package/package.json +4 -4
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
|
@@ -43,11 +43,13 @@ function removePoolProperties(credential) {
|
|
|
43
43
|
return credential;
|
|
44
44
|
}
|
|
45
45
|
function getPoolKey(credential) {
|
|
46
|
+
var _a;
|
|
46
47
|
if (credential.connectString && (credential.user && credential.password || credential.externalAuth)) {
|
|
47
|
-
return credential.connectString + '_' + (credential.externalAuth ? 'external' : credential.user + '_' + credential.password) + '_' + (credential.edition || '') + '_' + (credential.tag ? credential.tag + '#' + (credential.matchAny ? '1' : '0') : '') + '_' + (credential.privilege
|
|
48
|
+
return credential.connectString + '_' + (credential.externalAuth ? 'external' : credential.user + '_' + credential.password) + '_' + (credential.edition || '') + '_' + (credential.tag ? credential.tag + '#' + (credential.matchAny ? '1' : '0') : '') + '_' + ((_a = credential.privilege) !== null && _a !== void 0 ? _a : '') + '_' + Db.asString(credential.shardingKey) + '_' + Db.asString(credential.superShardingKey);
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
async function setCredential(item) {
|
|
52
|
+
var _a, _b, _c, _d, _e;
|
|
51
53
|
let credential = this.getCredential(item), hostname, port, username, database;
|
|
52
54
|
if (credential) {
|
|
53
55
|
({ hostname, port, username } = (0, util_1.parseServerAuth)(credential));
|
|
@@ -130,19 +132,19 @@ async function setCredential(item) {
|
|
|
130
132
|
if (config) {
|
|
131
133
|
const { min, max, idle, queue_max, queue_idle } = config;
|
|
132
134
|
if (min >= 0) {
|
|
133
|
-
credential.poolMin
|
|
135
|
+
(_a = credential.poolMin) !== null && _a !== void 0 ? _a : (credential.poolMin = min);
|
|
134
136
|
}
|
|
135
137
|
if (max > 0) {
|
|
136
|
-
credential.poolMax
|
|
138
|
+
(_b = credential.poolMax) !== null && _b !== void 0 ? _b : (credential.poolMax = max);
|
|
137
139
|
}
|
|
138
140
|
if (idle >= 0) {
|
|
139
|
-
credential.poolTimeout
|
|
141
|
+
(_c = credential.poolTimeout) !== null && _c !== void 0 ? _c : (credential.poolTimeout = idle / 1000);
|
|
140
142
|
}
|
|
141
143
|
if (queue_max >= 0) {
|
|
142
|
-
credential.queueMax
|
|
144
|
+
(_d = credential.queueMax) !== null && _d !== void 0 ? _d : (credential.queueMax = queue_max);
|
|
143
145
|
}
|
|
144
146
|
if (queue_idle >= 0) {
|
|
145
|
-
credential.queueTimeout
|
|
147
|
+
(_e = credential.queueTimeout) !== null && _e !== void 0 ? _e : (credential.queueTimeout = queue_idle);
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
150
|
new OraclePool(await oracledb.createPool(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/oracle",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Oracle 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.6.
|
|
25
|
-
"@e-mc/types": "^0.6.
|
|
26
|
-
"oracledb": "^6.
|
|
24
|
+
"@e-mc/db": "^0.6.7",
|
|
25
|
+
"@e-mc/types": "^0.6.7",
|
|
26
|
+
"oracledb": "^6.5.1"
|
|
27
27
|
}
|
|
28
28
|
}
|