Add support for more DB engines via TypeORM
[e-mobility-charging-stations-simulator.git] / src / utils / Configuration.ts
index 41ac9ba08f3fbf294d337075342c580be6170119..c1f867ca9a7b88301d362f5275590ccbe9afff7d 100644 (file)
@@ -31,7 +31,9 @@ export default class Configuration {
       {
         ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'enabled') ? { enabled: Configuration.getConfig().performanceStorage.enabled } : { enabled: false },
         ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'type') ? { type: Configuration.getConfig().performanceStorage.type } : { type: StorageType.JSON_FILE },
-        ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'URI') ? { URI: Configuration.getConfig().performanceStorage.URI } : { URI: 'file:///performanceMeasurements.json' }
+        ...Configuration.objectHasOwnProperty(Configuration.getConfig().performanceStorage, 'URI')
+          ? { URI: Configuration.getConfig().performanceStorage.URI }
+          : { URI: (Configuration.getConfig().performanceStorage.type === StorageType.JSON_FILE) ? 'file:///performanceMeasurements.json' : `file:///${Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME}.db` }
       };
     } else {
       storageConfiguration =