@pi-r/postgres 0.2.9 → 0.2.11

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 2020-24 Code Geass
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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @pi-r/postgres
2
2
 
3
- PEP 402 - Forever Josee + Nunnally
3
+ PEP 402 - Forever
4
4
 
5
5
  ## LICENSE
6
6
 
package/client/index.js CHANGED
@@ -53,6 +53,7 @@ function setAuthentication(credential) {
53
53
  }
54
54
  exports.setAuthentication = setAuthentication;
55
55
  function setCredential(item) {
56
+ var _a, _b, _c, _d;
56
57
  let credential = this.getCredential(item);
57
58
  if (credential) {
58
59
  setAuthentication.call(this, credential);
@@ -76,7 +77,7 @@ function setCredential(item) {
76
77
  const usePool = item.usePool;
77
78
  if (item.usePool && typeof credential.password !== 'function') {
78
79
  let username, password, pool;
79
- if (typeof usePool === 'string' && (username = credential.user || credential.connectionString && (0, util_1.parseConnectionString)(credential.connectionString)?.username)) {
80
+ if (typeof usePool === 'string' && (username = credential.user || credential.connectionString && ((_a = (0, util_1.parseConnectionString)(credential.connectionString)) === null || _a === void 0 ? void 0 : _a.username))) {
80
81
  [password, pool] = DbPool.validateKey(POOL_STATE, username, usePool);
81
82
  if (pool) {
82
83
  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 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.2.9",
3
+ "version": "0.2.11",
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.5.5",
25
- "@e-mc/types": "^0.5.5",
24
+ "@e-mc/db": "^0.5.6",
25
+ "@e-mc/types": "^0.5.6",
26
26
  "pg": "^8.11.5"
27
27
  }
28
28
  }