masterrecord 0.3.22 → 0.3.24

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.
@@ -35,7 +35,8 @@
35
35
  "Bash(done)",
36
36
  "WebSearch",
37
37
  "WebFetch(domain:github.com)",
38
- "Bash(master=development masterrecord update-database qaContext)"
38
+ "Bash(master=development masterrecord update-database qaContext)",
39
+ "Bash(chmod:*)"
39
40
  ],
40
41
  "deny": [],
41
42
  "ask": []
@@ -66,6 +66,9 @@ class EntityTrackerModel {
66
66
  }else{
67
67
  return this["__proto__"]["_" + modelField];
68
68
  }
69
+ }else{
70
+ // If skipGetFunction is true, return the raw value
71
+ return this["__proto__"]["_" + modelField];
69
72
  }
70
73
  }else{
71
74
  return this["__proto__"]["_" + modelField];
@@ -186,6 +186,14 @@ class queryMethods{
186
186
  this.__reset();
187
187
  return val;
188
188
  }
189
+
190
+ if(this.__context.isPostgres){
191
+ // trying to match string select and relace with select Count(*);
192
+ var entityValue = await this.__context._SQLEngine.getCount(this.__queryObject, this.__entity, this.__context);
193
+ var val = entityValue[Object.keys(entityValue)[0]];
194
+ this.__reset();
195
+ return val;
196
+ }
189
197
  }
190
198
 
191
199
  /**
@@ -366,6 +374,11 @@ class queryMethods{
366
374
  result = this.__singleEntityBuilder(entityValue[0]);
367
375
  }
368
376
 
377
+ if(this.__context.isPostgres){
378
+ var entityValue = await this.__context._SQLEngine.get(this.__queryObject.script, this.__entity, this.__context);
379
+ result = this.__singleEntityBuilder(entityValue[0]);
380
+ }
381
+
369
382
  // Store in cache
370
383
  if (this.__useCache && result) {
371
384
  this.__context._queryCache.set(cacheKey, result, tableName);
@@ -410,6 +423,11 @@ class queryMethods{
410
423
  result = this.__multipleEntityBuilder(entityValue);
411
424
  }
412
425
 
426
+ if(this.__context.isPostgres){
427
+ var entityValue = await this.__context._SQLEngine.all(this.__queryObject.script, this.__entity, this.__context);
428
+ result = this.__multipleEntityBuilder(entityValue);
429
+ }
430
+
413
431
  // Store in cache
414
432
  if (this.__useCache && result) {
415
433
  this.__context._queryCache.set(cacheKey, result, tableName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "masterrecord",
3
- "version": "0.3.22",
3
+ "version": "0.3.24",
4
4
  "description": "An Object-relational mapping for the Master framework. Master Record connects classes to relational database tables to establish a database with almost zero-configuration ",
5
5
  "main": "MasterRecord.js",
6
6
  "bin": {