@reldens/storage 0.10.0-beta.40 → 0.11.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.
package/README.md CHANGED
@@ -5,13 +5,13 @@
5
5
  ## About this package
6
6
  This package is designed to provide a standard drivers support for managing Reldens project data.
7
7
 
8
- This way in Reldens project we can trust that any driver implement will have the exact same methods available to fetch and manage the project entities.
8
+ This way in any Reldens project we can trust that any driver implementation will have the exact same methods available to fetch and manage the project entities.
9
9
 
10
10
  Every time you need to load, create, update or delete data in Reldens, the drivers from this package will be used.
11
11
 
12
12
  ## Current features
13
- The current drivers are to support two other ORMs:
14
- - Objection JS (with Knex), for everything that's SQL related.
13
+ The package currently has drivers to support two ORMs:
14
+ - Objection JS (with Knex), for everything that's SQL related (this is our base and recommended package).
15
15
  ```javascript
16
16
  let server = new ObjectionJsDataServer({
17
17
  client: 'mysql',
@@ -23,7 +23,7 @@ let server = new ObjectionJsDataServer({
23
23
  }
24
24
  });
25
25
  ```
26
- - Mikro-ORM, to offer support for MongoDB.
26
+ - Mikro-ORM, to offer support for nonSQL/MongoDB (this package is not finished, if you like to use it please contact us).
27
27
  ```javascript
28
28
  let server = new MikroOrmDataServer({
29
29
  client: 'mongodb',
@@ -203,6 +203,7 @@ class MikroOrmDriver extends BaseDriver
203
203
  return this.appendRelationsToCollection(entitiesCollection, relations);
204
204
  }
205
205
 
206
+ // @TODO - BETA - Refactor and improve.
206
207
  queryBuilder(useLimit = false, useOffset = false, useSort = false)
207
208
  {
208
209
  let queryBuilder = {};
@@ -220,6 +221,7 @@ class MikroOrmDriver extends BaseDriver
220
221
  return queryBuilder;
221
222
  }
222
223
 
224
+ // @TODO - BETA - Refactor and improve.
223
225
  createSingleFilter(field, fieldValue, operator = null)
224
226
  {
225
227
  let filter = {};
@@ -232,6 +234,7 @@ class MikroOrmDriver extends BaseDriver
232
234
  return filter;
233
235
  }
234
236
 
237
+ // @TODO - BETA - Refactor and improve.
235
238
  async appendRelationsToCollection(entitiesCollection, relations)
236
239
  {
237
240
  // @TODO - BETA - Refactor. I would like to use populate but it may not work if the driver is not Mongo DB.
@@ -255,9 +258,9 @@ class MikroOrmDriver extends BaseDriver
255
258
  return entitiesCollection;
256
259
  }
257
260
 
261
+ // @TODO - BETA - Refactor and improve.
258
262
  async appendRelatedEntities(entity, relations)
259
263
  {
260
- // @TODO - BETA - Refactor and improve.
261
264
  if('function' !== typeof this.rawModel.entity.relationMappings){
262
265
  return entity;
263
266
  }
@@ -277,6 +280,7 @@ class MikroOrmDriver extends BaseDriver
277
280
  return entity;
278
281
  }
279
282
 
283
+ // @TODO - BETA - Refactor and improve.
280
284
  async createNested(newInstance, params)
281
285
  {
282
286
  if('function' !== typeof this.rawModel.entity.relationMappings){
@@ -284,7 +288,6 @@ class MikroOrmDriver extends BaseDriver
284
288
  }
285
289
  let relationMappings = this.rawModel.entity.relationMappings();
286
290
  for(let i of Object.keys(relationMappings)){
287
- // @TODO - BETA - Refactor and improve.
288
291
  let relation = relationMappings[i];
289
292
  let relationEntity = this.server.entityManager.get(relation.entityName).rawModel.entity;
290
293
  if(!relationEntity){
@@ -305,6 +308,7 @@ class MikroOrmDriver extends BaseDriver
305
308
  }
306
309
  }
307
310
 
311
+ // @TODO - BETA - Refactor and improve.
308
312
  async createOne(params, i, relationEntity, newInstance, relation)
309
313
  {
310
314
  params[i] = newInstance[relation.join.from];
@@ -314,6 +318,7 @@ class MikroOrmDriver extends BaseDriver
314
318
  newInstance[i] = nestedObject;
315
319
  }
316
320
 
321
+ // @TODO - BETA - Refactor and improve.
317
322
  async createMany(params, i, relationEntity, newInstance, relation)
318
323
  {
319
324
  let nestedArray = [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reldens/storage",
3
3
  "scope": "@reldens",
4
- "version": "0.10.0-beta.40",
4
+ "version": "0.11.0",
5
5
  "description": "Reldens - Storage",
6
6
  "author": "Damian A. Pastorini",
7
7
  "license": "MIT",
@@ -44,9 +44,9 @@
44
44
  "url": "https://github.com/damian-pastorini/reldens-storage/issues"
45
45
  },
46
46
  "dependencies": {
47
- "@mikro-orm/core": "^5.0.1",
48
- "@mikro-orm/mongodb": "^5.0.1",
49
- "@reldens/utils": "^0.10.0-beta.4",
47
+ "@mikro-orm/core": "^5.0.3",
48
+ "@mikro-orm/mongodb": "^5.0.3",
49
+ "@reldens/utils": "^0.11.0",
50
50
  "knex": "^1.0.3",
51
51
  "mysql": "^2.18.1",
52
52
  "objection": "^3.0.1"