@dismissible/nestjs-postgres-storage 0.0.2-canary.8976e84.0 → 0.0.2-canary.c91edbc.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dismissible/nestjs-postgres-storage",
3
- "version": "0.0.2-canary.8976e84.0",
3
+ "version": "0.0.2-canary.c91edbc.0",
4
4
  "description": "PostgreSQL storage adapter for Dismissible using Prisma",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -20,9 +20,9 @@
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@nestjs/common": "^11.0.0",
23
- "@dismissible/nestjs-storage": "^0.0.2-canary.8976e84.0",
24
- "@dismissible/nestjs-dismissible-item": "^0.0.2-canary.8976e84.0",
25
- "@dismissible/nestjs-logger": "^0.0.2-canary.8976e84.0",
23
+ "@dismissible/nestjs-storage": "^0.0.2-canary.c91edbc.0",
24
+ "@dismissible/nestjs-dismissible-item": "^0.0.2-canary.c91edbc.0",
25
+ "@dismissible/nestjs-logger": "^0.0.2-canary.c91edbc.0",
26
26
  "prisma": "^7.0.0"
27
27
  },
28
28
  "peerDependenciesMeta": {
@@ -23,7 +23,18 @@ export class PrismaService extends PrismaClient implements OnModuleInit, OnModul
23
23
  async onModuleInit(): Promise<void> {
24
24
  this.logger.debug('Connecting to PostgreSQL database');
25
25
  await this.$connect();
26
- this.logger.debug('Connected to PostgreSQL database');
26
+
27
+ // Verify connection by executing a real query
28
+ try {
29
+ await this.$queryRaw`SELECT 1`;
30
+ this.logger.debug('Connected to PostgreSQL database');
31
+ } catch (error) {
32
+ this.logger.error('Failed to connect to PostgreSQL database', error);
33
+ throw new Error(
34
+ `Database connection failed: ${error instanceof Error ? error.message : 'Unknown error'}. ` +
35
+ 'Ensure PostgreSQL is running and DISMISSIBLE_POSTGRES_STORAGE_CONNECTION_STRING is configured correctly.',
36
+ );
37
+ }
27
38
  }
28
39
 
29
40
  async onModuleDestroy(): Promise<void> {