@friggframework/core 2.0.0--canary.461.97d93c9.0 → 2.0.0--canary.461.a0527a3.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.
@@ -4,13 +4,22 @@
4
4
  */
5
5
 
6
6
  /**
7
- * Determines database type from app definition
8
- * Reads backend/index.js Definition.database configuration
7
+ * Determines database type from environment or app definition
8
+ *
9
+ * Detection order:
10
+ * 1. DB_TYPE environment variable (set for migration handlers)
11
+ * 2. App definition (backend/index.js Definition.database configuration)
9
12
  *
10
13
  * @returns {'mongodb'|'postgresql'} Database type
11
14
  * @throws {Error} If database type cannot be determined or app definition missing
12
15
  */
13
16
  function getDatabaseType() {
17
+ // First, check DB_TYPE environment variable (migration handlers set this)
18
+ if (process.env.DB_TYPE) {
19
+ return process.env.DB_TYPE;
20
+ }
21
+
22
+ // Fallback: Load app definition
14
23
  try {
15
24
  const path = require('node:path');
16
25
  const fs = require('node:fs');
@@ -28,7 +28,7 @@ describe('Database Migration Router - Adapter Layer', () => {
28
28
  it('should load without requiring app definition (critical bug fix)', () => {
29
29
  // Before fix: createProcessRepository() → getDatabaseType() → loads app definition → requires integrations → CRASH
30
30
  // After fix: ProcessRepositoryPostgres instantiated directly → no app definition → SUCCESS
31
-
31
+
32
32
  expect(() => {
33
33
  require('./db-migration');
34
34
  }).not.toThrow();
@@ -105,7 +105,7 @@ function sanitizeDatabaseUrl(url) {
105
105
  function extractMigrationParams(event) {
106
106
  let processId = null;
107
107
  let stage = null;
108
-
108
+
109
109
  // Migration infrastructure is PostgreSQL-only, so hardcode dbType
110
110
  const dbType = 'postgresql';
111
111
 
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.97d93c9.0",
4
+ "version": "2.0.0--canary.461.a0527a3.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.97d93c9.0",
41
- "@friggframework/prettier-config": "2.0.0--canary.461.97d93c9.0",
42
- "@friggframework/test": "2.0.0--canary.461.97d93c9.0",
40
+ "@friggframework/eslint-config": "2.0.0--canary.461.a0527a3.0",
41
+ "@friggframework/prettier-config": "2.0.0--canary.461.a0527a3.0",
42
+ "@friggframework/test": "2.0.0--canary.461.a0527a3.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": "97d93c9143829a56c166c50c1127961fba83bfa0"
82
+ "gitHead": "a0527a318705a351410471083bb6e5a6b6dc7165"
83
83
  }