@friggframework/core 2.0.0--canary.461.9483dbe.0 → 2.0.0--canary.461.637e5e4.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.
Files changed (2) hide show
  1. package/database/prisma.js +24 -2
  2. package/package.json +5 -5
@@ -75,11 +75,33 @@ function loadCustomEncryptionSchema() {
75
75
 
76
76
  const prismaClientSingleton = () => {
77
77
  let PrismaClient;
78
+
79
+ // Helper to try loading Prisma client from multiple locations
80
+ const loadPrismaClient = (dbType) => {
81
+ const paths = [
82
+ // Lambda layer location (when using Prisma Lambda layer)
83
+ `/opt/nodejs/node_modules/generated/prisma-${dbType}`,
84
+ // Local development location (relative to core package)
85
+ `../generated/prisma-${dbType}`,
86
+ ];
87
+
88
+ for (const path of paths) {
89
+ try {
90
+ return require(path).PrismaClient;
91
+ } catch (err) {
92
+ // Continue to next path
93
+ }
94
+ }
95
+
96
+ throw new Error(
97
+ `Cannot find Prisma client for ${dbType}. Tried paths: ${paths.join(', ')}`
98
+ );
99
+ };
78
100
 
79
101
  if (config.DB_TYPE === 'mongodb') {
80
- PrismaClient = require('../generated/prisma-mongodb').PrismaClient;
102
+ PrismaClient = loadPrismaClient('mongodb');
81
103
  } else if (config.DB_TYPE === 'postgresql') {
82
- PrismaClient = require('../generated/prisma-postgresql').PrismaClient;
104
+ PrismaClient = loadPrismaClient('postgresql');
83
105
  } else {
84
106
  throw new Error(
85
107
  `Unsupported database type: ${config.DB_TYPE}. Supported values: 'mongodb', 'postgresql'`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@friggframework/core",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "2.0.0--canary.461.9483dbe.0",
4
+ "version": "2.0.0--canary.461.637e5e4.0",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
7
7
  "@aws-sdk/client-kms": "^3.588.0",
@@ -37,9 +37,9 @@
37
37
  }
38
38
  },
39
39
  "devDependencies": {
40
- "@friggframework/eslint-config": "2.0.0--canary.461.9483dbe.0",
41
- "@friggframework/prettier-config": "2.0.0--canary.461.9483dbe.0",
42
- "@friggframework/test": "2.0.0--canary.461.9483dbe.0",
40
+ "@friggframework/eslint-config": "2.0.0--canary.461.637e5e4.0",
41
+ "@friggframework/prettier-config": "2.0.0--canary.461.637e5e4.0",
42
+ "@friggframework/test": "2.0.0--canary.461.637e5e4.0",
43
43
  "@prisma/client": "^6.17.0",
44
44
  "@types/lodash": "4.17.15",
45
45
  "@typescript-eslint/eslint-plugin": "^8.0.0",
@@ -79,5 +79,5 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
- "gitHead": "9483dbe2bfd6479f5b6fc24c59b0aa646689f887"
82
+ "gitHead": "637e5e421b5de0794ae99dc8a6578726dfd97f27"
83
83
  }