@faasjs/knex 0.0.3-beta.49 → 0.0.3-beta.50

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 CHANGED
@@ -66,7 +66,7 @@ var Knex = class {
66
66
  await next();
67
67
  }
68
68
  async onMount(data, next) {
69
- var _a;
69
+ var _a, _b;
70
70
  this.logger = data.logger;
71
71
  if (global.FaasJS_Knex[this.name]) {
72
72
  this.config = global.FaasJS_Knex[this.name].config;
@@ -93,6 +93,16 @@ var Knex = class {
93
93
  this.config = (0, import_deep_merge.deepMerge)(data.config.plugins[this.name].config, this.config);
94
94
  if (this.config.client === "sqlite3")
95
95
  this.config.client = "better-sqlite3";
96
+ if (this.config.client === "pg" && typeof ((_b = this.config.pool) == null ? void 0 : _b.propagateCreateError) === "undefined") {
97
+ if (!this.config.pool)
98
+ this.config.pool = /* @__PURE__ */ Object.create(null);
99
+ this.config.pool = Object.assign({
100
+ propagateCreateError: false,
101
+ min: 0,
102
+ max: 10,
103
+ acquireTimeoutMillis: 2e3
104
+ }, this.config.pool);
105
+ }
96
106
  this.adapter = (0, import_knex.default)(this.config);
97
107
  if (this.config.client === "pg") {
98
108
  const pg = require("pg");
package/dist/index.mjs CHANGED
@@ -42,7 +42,7 @@ var Knex = class {
42
42
  await next();
43
43
  }
44
44
  async onMount(data, next) {
45
- var _a;
45
+ var _a, _b;
46
46
  this.logger = data.logger;
47
47
  if (global.FaasJS_Knex[this.name]) {
48
48
  this.config = global.FaasJS_Knex[this.name].config;
@@ -69,6 +69,16 @@ var Knex = class {
69
69
  this.config = deepMerge(data.config.plugins[this.name].config, this.config);
70
70
  if (this.config.client === "sqlite3")
71
71
  this.config.client = "better-sqlite3";
72
+ if (this.config.client === "pg" && typeof ((_b = this.config.pool) == null ? void 0 : _b.propagateCreateError) === "undefined") {
73
+ if (!this.config.pool)
74
+ this.config.pool = /* @__PURE__ */ Object.create(null);
75
+ this.config.pool = Object.assign({
76
+ propagateCreateError: false,
77
+ min: 0,
78
+ max: 10,
79
+ acquireTimeoutMillis: 2e3
80
+ }, this.config.pool);
81
+ }
72
82
  this.adapter = knex(this.config);
73
83
  if (this.config.client === "pg") {
74
84
  const pg = __require("pg");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/knex",
3
- "version": "0.0.3-beta.49",
3
+ "version": "0.0.3-beta.50",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,9 +22,9 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@faasjs/deep_merge": "^0.0.3-beta.49",
26
- "@faasjs/func": "^0.0.3-beta.49",
27
- "@faasjs/logger": "^0.0.3-beta.49",
25
+ "@faasjs/deep_merge": "^0.0.3-beta.50",
26
+ "@faasjs/func": "^0.0.3-beta.50",
27
+ "@faasjs/logger": "^0.0.3-beta.50",
28
28
  "knex": "*"
29
29
  },
30
30
  "devDependencies": {