@pi-r/postgres 0.3.3 → 0.3.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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2023 Lisa Mishima
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
@@ -54,6 +54,7 @@ function setAuthentication(credential) {
54
54
  }
55
55
  exports.setAuthentication = setAuthentication;
56
56
  function setCredential(item) {
57
+ var _a, _b, _c, _d;
57
58
  let credential = this.getCredential(item);
58
59
  if (credential) {
59
60
  setAuthentication.call(this, credential);
@@ -77,7 +78,7 @@ function setCredential(item) {
77
78
  const usePool = item.usePool;
78
79
  if (item.usePool && typeof credential.password !== 'function') {
79
80
  let username, password, pool;
80
- if (typeof usePool === 'string' && (username = credential.user || credential.connectionString && (0, util_1.parseConnectionString)(credential.connectionString)?.username)) {
81
+ if (typeof usePool === 'string' && (username = credential.user || credential.connectionString && ((_a = (0, util_1.parseConnectionString)(credential.connectionString)) === null || _a === void 0 ? void 0 : _a.username))) {
81
82
  [password, pool] = DbPool.validateKey(POOL_STATE, username, usePool);
82
83
  if (pool) {
83
84
  pool.add(item, password);
@@ -90,13 +91,13 @@ function setCredential(item) {
90
91
  if (config) {
91
92
  const { min, max, idle } = config;
92
93
  if (min >= 0) {
93
- credential.min ?? (credential.min = min);
94
+ (_b = credential.min) !== null && _b !== void 0 ? _b : (credential.min = min);
94
95
  }
95
96
  if (max > 0) {
96
- credential.max ?? (credential.max = max);
97
+ (_c = credential.max) !== null && _c !== void 0 ? _c : (credential.max = max);
97
98
  }
98
99
  if (idle > 0) {
99
- credential.idleTimeoutMillis ?? (credential.idleTimeoutMillis = idle);
100
+ (_d = credential.idleTimeoutMillis) !== null && _d !== void 0 ? _d : (credential.idleTimeoutMillis = idle);
100
101
  }
101
102
  }
102
103
  new PostgresPool(new postgres.Pool(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/postgres",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
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.2",
25
- "@e-mc/types": "^0.6.2",
24
+ "@e-mc/db": "^0.6.3",
25
+ "@e-mc/types": "^0.6.3",
26
26
  "pg": "^8.11.5"
27
27
  }
28
28
  }