@reldens/storage 0.94.0 → 0.95.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.
@@ -29,7 +29,7 @@ class PrismaClientLoader
29
29
  }
30
30
  if(!connectionData){
31
31
  Logger.info('Creating PrismaClient with default connection from schema');
32
- return new prismaModule.PrismaClient({adapter: new PrismaMariaDb(process.env.DATABASE_URL), log: ['error']});
32
+ return PrismaClientLoader.createWithAdapter(prismaModule.PrismaClient, process.env.DATABASE_URL);
33
33
  }
34
34
  let connectionString = connectionData.client+'://'
35
35
  +connectionData.user
@@ -38,7 +38,17 @@ class PrismaClientLoader
38
38
  +':'+connectionData.port
39
39
  +'/'+connectionData.database;
40
40
  Logger.info('Creating PrismaClient with connection to: '+connectionData.database);
41
- return new prismaModule.PrismaClient({adapter: new PrismaMariaDb(connectionString), log: ['error']});
41
+ return PrismaClientLoader.createWithAdapter(prismaModule.PrismaClient, connectionString);
42
+ }
43
+
44
+ /**
45
+ * @param {Function} PrismaClientClass
46
+ * @param {string} connectionUrl
47
+ * @returns {Object}
48
+ */
49
+ static createWithAdapter(PrismaClientClass, connectionUrl)
50
+ {
51
+ return new PrismaClientClass({adapter: new PrismaMariaDb(connectionUrl), log: ['error']});
42
52
  }
43
53
 
44
54
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reldens/storage",
3
3
  "scope": "@reldens",
4
- "version": "0.94.0",
4
+ "version": "0.95.0",
5
5
  "description": "Reldens - Storage",
6
6
  "author": "Damian A. Pastorini",
7
7
  "license": "MIT",
@@ -54,7 +54,7 @@
54
54
  "@mikro-orm/core": "7.0.14",
55
55
  "@mikro-orm/mongodb": "7.0.14",
56
56
  "@mikro-orm/mysql": "7.0.14",
57
- "@prisma/adapter-mariadb": "^7.8.0",
57
+ "@prisma/adapter-mariadb": "7.8.0",
58
58
  "@prisma/client": "7.8.0",
59
59
  "@reldens/server-utils": "^0.50.0",
60
60
  "@reldens/utils": "^0.56.0",