masterrecord 0.1.3 → 0.1.4

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/context.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version 0.0.8
1
+ // Version 0.0.9
2
2
 
3
3
  var modelBuilder = require('./Entity/entityModelBuilder');
4
4
  var query = require('masterrecord/QueryLanguage/queryMethods');
@@ -279,8 +279,11 @@ class context {
279
279
 
280
280
  catch(error){
281
281
  this.__clearErrorHandler();
282
- //this._SQLEngine.errorTransaction();
282
+
283
283
  console.log("error", error);
284
+ if(this.isSQLite){
285
+ this._SQLEngine.errorTransaction();
286
+ }
284
287
  this.__clearTracked();
285
288
  throw error;
286
289
  }
package/insertManager.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- // version 0.0.5
2
+ // version 0.0.6
3
3
  var tools = require('./Tools');
4
4
  var queryScript = require('masterrecord/QueryLanguage/queryScript');
5
5
 
@@ -32,7 +32,16 @@ class InsertManager {
32
32
  var query = `select * from ${currentModel.__entity.__name} where ${primaryKey} = ${ SQL.id }`;
33
33
  var jj = this.__queryObject.raw(query);
34
34
  var getQueryModel = this._SQLEngine.get(jj, currentModel.__entity, currentModel.__context );
35
- currentModel[primaryKey] = getQueryModel[0][primaryKey];
35
+ var idVal;
36
+
37
+ if(!getQueryModel[0]){
38
+ idVal = getQueryModel[primaryKey]
39
+ }
40
+ else{
41
+ idVal = getQueryModel[0][primaryKey];
42
+ }
43
+
44
+ currentModel[primaryKey] = idVal;
36
45
  }
37
46
 
38
47
  const modelKeys = Object.keys(currentModel);
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "sync-mysql2" : "^1.0.5",
9
9
  "app-root-path": "^3.1.0"
10
10
  },
11
- "version": "0.1.3",
11
+ "version": "0.1.4",
12
12
  "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 ",
13
13
  "homepage": "https://github.com/Tailor/MasterRecord#readme",
14
14
  "repository": {