@friggframework/core 2.0.0--canary.490.d8be1b9.0 → 2.0.0--canary.490.ff25f6f.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.
@@ -11,8 +11,8 @@ function setDatabaseInitializer(initializer) {
11
11
 
12
12
  function getDefaultDatabaseInitializer() {
13
13
  if (!databaseInitializer) {
14
- const { connectPrisma } = require('../database/prisma');
15
- databaseInitializer = connectPrisma;
14
+ const { connectDatabase } = require('../database/connect-database');
15
+ databaseInitializer = connectDatabase;
16
16
  }
17
17
  return databaseInitializer;
18
18
  }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Database Connection Orchestrator
3
+ * Handles connection for both Prisma and native MongoDB driver
4
+ */
5
+
6
+ const { isDocumentDB } = require('./utils/documentdb-compatibility');
7
+ const { logger } = require('../logs');
8
+
9
+ async function connectDatabase() {
10
+ if (isDocumentDB()) {
11
+ logger.info('Connecting to DocumentDB using native MongoDB driver...');
12
+ const { getNativeMongoClient } = require('./mongodb-native-client');
13
+ const nativeClient = getNativeMongoClient();
14
+ await nativeClient.connect();
15
+ logger.info('✓ Native MongoDB client connected');
16
+ } else {
17
+ logger.info('Connecting using Prisma...');
18
+ const { connectPrisma } = require('./prisma');
19
+ await connectPrisma();
20
+ logger.info('✓ Prisma client connected');
21
+ }
22
+ }
23
+
24
+ module.exports = { connectDatabase };
25
+
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.490.d8be1b9.0",
4
+ "version": "2.0.0--canary.490.ff25f6f.0",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
7
7
  "@aws-sdk/client-kms": "^3.588.0",
@@ -38,9 +38,9 @@
38
38
  }
39
39
  },
40
40
  "devDependencies": {
41
- "@friggframework/eslint-config": "2.0.0--canary.490.d8be1b9.0",
42
- "@friggframework/prettier-config": "2.0.0--canary.490.d8be1b9.0",
43
- "@friggframework/test": "2.0.0--canary.490.d8be1b9.0",
41
+ "@friggframework/eslint-config": "2.0.0--canary.490.ff25f6f.0",
42
+ "@friggframework/prettier-config": "2.0.0--canary.490.ff25f6f.0",
43
+ "@friggframework/test": "2.0.0--canary.490.ff25f6f.0",
44
44
  "@prisma/client": "^6.17.0",
45
45
  "@types/lodash": "4.17.15",
46
46
  "@typescript-eslint/eslint-plugin": "^8.0.0",
@@ -80,5 +80,5 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "d8be1b9d24b459e074d7f39344386e843987625e"
83
+ "gitHead": "ff25f6f69edbe59380ab2e916211a3bc50086d7f"
84
84
  }