@nestjs-kitchen/connextion-postgres 1.0.3 → 2.0.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.
package/dist/index.js CHANGED
@@ -15,12 +15,12 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var src_exports = {};
19
- __export(src_exports, {
18
+ var index_exports = {};
19
+ __export(index_exports, {
20
20
  PostgresError: () => import_errors.PostgresError,
21
21
  definePostgres: () => import_define_postgres.definePostgres
22
22
  });
23
- module.exports = __toCommonJS(src_exports);
23
+ module.exports = __toCommonJS(index_exports);
24
24
  var import_polyfill = require("./polyfill");
25
25
  var import_define_postgres = require("./define-postgres");
26
26
  var import_errors = require("./errors");
@@ -71,10 +71,14 @@ const _PostgresInstance = class _PostgresInstance extends import_connextion.Conn
71
71
  }
72
72
  create(options) {
73
73
  this.dispose();
74
- const pool = new import_pg.Pool(options);
75
- pool.on("connect", this.listener1);
76
- pool.on("error", this.listener2);
77
- this.pool = pool;
74
+ try {
75
+ const pool = new import_pg.Pool(options);
76
+ pool.on("connect", this.listener1);
77
+ pool.on("error", this.listener2);
78
+ this.pool = pool;
79
+ } catch (error) {
80
+ this.logger.error(error.message);
81
+ }
78
82
  }
79
83
  async [(_a = import_constants.ALS, import_constants.GET_CLIENT)]() {
80
84
  if (!this.pool) {
@@ -100,11 +104,12 @@ const _PostgresInstance = class _PostgresInstance extends import_connextion.Conn
100
104
  throw new import_errors.PostgresError("client not found");
101
105
  }
102
106
  return new Proxy(client, {
103
- get(target, prop) {
107
+ get(target, prop, receiver) {
108
+ const value = Reflect.get(target, prop, receiver);
104
109
  if (debug.client[prop]) {
105
- return debug.client[prop](target[prop].bind(target));
110
+ return debug.client[prop](value.bind(target));
106
111
  }
107
- return target[prop];
112
+ return value;
108
113
  }
109
114
  });
110
115
  }
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PoolClient, PoolConfig } from 'pg';
1
+ import { PoolConfig, PoolClient } from 'pg';
2
2
 
3
3
  type ALSQueryType = Error | true;
4
4
  interface ALSType {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@nestjs-kitchen/connextion-postgres",
3
3
  "private": false,
4
4
  "description": "A flexible module to provide node-postgres interface in NextJS.",
5
- "version": "1.0.3",
5
+ "version": "2.0.0",
6
6
  "homepage": "https://github.com/yikenman/nestjs-kitchen",
7
7
  "repository": "https://github.com/yikenman/nestjs-kitchen",
8
8
  "author": "yikenman",
@@ -22,16 +22,16 @@
22
22
  "uid": "^2.0.2"
23
23
  },
24
24
  "devDependencies": {
25
- "@nestjs/testing": "^10.4.15",
25
+ "@nestjs/testing": "^11.0.10",
26
26
  "@types/jest": "^29.5.14",
27
- "@types/node": "^22.10.5",
27
+ "@types/node": "^22.13.5",
28
28
  "jest": "^29.7.0",
29
- "ts-jest": "^29.1.2",
29
+ "ts-jest": "^29.2.6",
30
30
  "ts-node": "^10.9.2",
31
31
  "tsconfig-paths": "^4.2.0",
32
- "tsup": "^8.3.5",
33
- "typescript": "^5.7.2",
34
- "@nestjs-kitchen/connextion": "1.0.2"
32
+ "tsup": "^8.4.0",
33
+ "typescript": "^5.7.3",
34
+ "@nestjs-kitchen/connextion": "2.0.0"
35
35
  },
36
36
  "engines": {
37
37
  "node": ">=20.13.0"
@@ -47,11 +47,11 @@
47
47
  "SQL"
48
48
  ],
49
49
  "peerDependencies": {
50
- "@nestjs/common": "^10.4.15",
50
+ "@nestjs/common": "^11.0.10",
51
51
  "@types/pg": "^8.11.10",
52
52
  "pg": "^8.13.1",
53
- "reflect-metadata": "^0.2.1",
54
- "@nestjs-kitchen/connextion": "1.0.2"
53
+ "reflect-metadata": "^0.2.2",
54
+ "@nestjs-kitchen/connextion": "2.0.0"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "tsup",