@pi-r/postgres 0.3.0 → 0.5.0

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.
Files changed (2) hide show
  1. package/client/index.js +4 -1
  2. package/package.json +4 -4
package/client/index.js CHANGED
@@ -88,7 +88,7 @@ function setCredential(item) {
88
88
  if (!(pool = POOL_STATE[poolKey]) || pool.closed) {
89
89
  const config = this.getPoolConfig("postgres" /* STRINGS.MODULE_NAME */, password);
90
90
  if (config) {
91
- const { min, max, idle } = config;
91
+ const { min, max, idle, timeout } = config;
92
92
  if (min >= 0) {
93
93
  credential.min ?? (credential.min = min);
94
94
  }
@@ -98,6 +98,9 @@ function setCredential(item) {
98
98
  if (idle > 0) {
99
99
  credential.idleTimeoutMillis ?? (credential.idleTimeoutMillis = idle);
100
100
  }
101
+ if (timeout > 0) {
102
+ credential.connectionTimeoutMillis ?? (credential.connectionTimeoutMillis = timeout);
103
+ }
101
104
  }
102
105
  new PostgresPool(new postgres.Pool(credential), poolKey, username && password ? { username, password } : undefined).add(item).parent = POOL_STATE;
103
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/postgres",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "PostgreSQL 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.0",
25
- "@e-mc/types": "^0.6.0",
26
- "pg": "^8.11.2"
24
+ "@e-mc/db": "^0.7.0",
25
+ "@e-mc/types": "^0.7.0",
26
+ "pg": "^8.11.3"
27
27
  }
28
28
  }