@reldens/storage 0.77.0 → 0.78.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.
@@ -66,6 +66,11 @@ class BaseDataServer
66
66
  ErrorManager.error('BaseDriver connect() not implemented.');
67
67
  }
68
68
 
69
+ async disconnect()
70
+ {
71
+ ErrorManager.error('BaseDriver disconnect() not implemented.');
72
+ }
73
+
69
74
  async fetchEntitiesFromDatabase()
70
75
  {
71
76
  ErrorManager.error('BaseDriver fetchEntitiesFromDatabase() not implemented.');
@@ -54,6 +54,15 @@ class MikroOrmDataServer extends BaseDataServer
54
54
  return this.initialized;
55
55
  }
56
56
 
57
+ async disconnect()
58
+ {
59
+ if(!this.orm){
60
+ return false;
61
+ }
62
+ await this.orm.close();
63
+ return true;
64
+ }
65
+
57
66
  generateEntities()
58
67
  {
59
68
  if(!this.initialized){
@@ -47,6 +47,15 @@ class ObjectionJsDataServer extends BaseDataServer
47
47
  return this.initialized;
48
48
  }
49
49
 
50
+ async disconnect()
51
+ {
52
+ if(!this.knex){
53
+ return false;
54
+ }
55
+ await this.knex.destroy();
56
+ return true;
57
+ }
58
+
50
59
  generateEntities()
51
60
  {
52
61
  if(!this.rawEntities){
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reldens/storage",
3
3
  "scope": "@reldens",
4
- "version": "0.77.0",
4
+ "version": "0.78.0",
5
5
  "description": "Reldens - Storage",
6
6
  "author": "Damian A. Pastorini",
7
7
  "license": "MIT",