@faasjs/knex 3.1.2 → 3.1.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/dist/index.js +4 -3
- package/dist/index.mjs +4 -3
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
16
16
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
17
17
|
});
|
|
18
18
|
var originKnex = knex__default.default;
|
|
19
|
-
var Name = "
|
|
19
|
+
var Name = "knex";
|
|
20
20
|
if (!global.FaasJS_Knex) {
|
|
21
21
|
global.FaasJS_Knex = {};
|
|
22
22
|
}
|
|
@@ -58,9 +58,9 @@ var Knex = class {
|
|
|
58
58
|
this.config.connection[key.replace("connection_", "")] = value;
|
|
59
59
|
} else this.config[key] = value;
|
|
60
60
|
}
|
|
61
|
-
if (data.config.plugins?.[this.name]?.config)
|
|
61
|
+
if (data.config.plugins?.[this.name || this.type]?.config)
|
|
62
62
|
this.config = deep_merge.deepMerge(
|
|
63
|
-
data.config.plugins[this.name].config,
|
|
63
|
+
data.config.plugins[this.name || this.type].config,
|
|
64
64
|
this.config
|
|
65
65
|
);
|
|
66
66
|
switch (this.config.client) {
|
|
@@ -191,6 +191,7 @@ var Knex = class {
|
|
|
191
191
|
return this.adapter.schema;
|
|
192
192
|
}
|
|
193
193
|
async quit() {
|
|
194
|
+
if (!global.FaasJS_Knex[this.name]) return;
|
|
194
195
|
try {
|
|
195
196
|
await global.FaasJS_Knex[this.name].adapter.destroy();
|
|
196
197
|
delete global.FaasJS_Knex[this.name];
|
package/dist/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
10
10
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
11
11
|
});
|
|
12
12
|
var originKnex = knex;
|
|
13
|
-
var Name = "
|
|
13
|
+
var Name = "knex";
|
|
14
14
|
if (!global.FaasJS_Knex) {
|
|
15
15
|
global.FaasJS_Knex = {};
|
|
16
16
|
}
|
|
@@ -52,9 +52,9 @@ var Knex = class {
|
|
|
52
52
|
this.config.connection[key.replace("connection_", "")] = value;
|
|
53
53
|
} else this.config[key] = value;
|
|
54
54
|
}
|
|
55
|
-
if (data.config.plugins?.[this.name]?.config)
|
|
55
|
+
if (data.config.plugins?.[this.name || this.type]?.config)
|
|
56
56
|
this.config = deepMerge(
|
|
57
|
-
data.config.plugins[this.name].config,
|
|
57
|
+
data.config.plugins[this.name || this.type].config,
|
|
58
58
|
this.config
|
|
59
59
|
);
|
|
60
60
|
switch (this.config.client) {
|
|
@@ -185,6 +185,7 @@ var Knex = class {
|
|
|
185
185
|
return this.adapter.schema;
|
|
186
186
|
}
|
|
187
187
|
async quit() {
|
|
188
|
+
if (!global.FaasJS_Knex[this.name]) return;
|
|
188
189
|
try {
|
|
189
190
|
await global.FaasJS_Knex[this.name].adapter.destroy();
|
|
190
191
|
delete global.FaasJS_Knex[this.name];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/knex",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@faasjs/deep_merge": "3.1.
|
|
38
|
-
"@faasjs/func": "3.1.
|
|
39
|
-
"@faasjs/logger": "3.1.
|
|
37
|
+
"@faasjs/deep_merge": "3.1.4",
|
|
38
|
+
"@faasjs/func": "3.1.4",
|
|
39
|
+
"@faasjs/logger": "3.1.4"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"knex": "*"
|