@nestjs-kitchen/connextion-postgres 1.0.4 → 2.0.1

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.
@@ -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/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.4",
5
+ "version": "2.0.1",
6
6
  "homepage": "https://github.com/yikenman/nestjs-kitchen",
7
7
  "repository": "https://github.com/yikenman/nestjs-kitchen",
8
8
  "author": "yikenman",
@@ -22,7 +22,7 @@
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
27
  "@types/node": "^22.13.5",
28
28
  "jest": "^29.7.0",
@@ -31,7 +31,7 @@
31
31
  "tsconfig-paths": "^4.2.0",
32
32
  "tsup": "^8.4.0",
33
33
  "typescript": "^5.7.3",
34
- "@nestjs-kitchen/connextion": "1.0.3"
34
+ "@nestjs-kitchen/connextion": "2.0.1"
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": "^10.0.0 || ^11.0.0",
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.3"
53
+ "reflect-metadata": "^0.2.2",
54
+ "@nestjs-kitchen/connextion": "2.0.1"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "tsup",