masterrecord 0.1.1 → 0.1.3
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/SQLLiteEngine.js +33 -14
- package/context.js +4 -1
- package/package.json +5 -5
package/SQLLiteEngine.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version 0.0.
|
|
1
|
+
// Version 0.0.13
|
|
2
2
|
var tools = require('masterrecord/Tools');
|
|
3
3
|
|
|
4
4
|
class SQLLiteEngine {
|
|
@@ -423,13 +423,22 @@ class SQLLiteEngine {
|
|
|
423
423
|
return "";
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
426
|
+
// return a list of entity names and skip foreign keys and underscore.
|
|
427
|
+
getEntityList(entity){
|
|
428
|
+
var entitiesList = [];
|
|
429
|
+
var $that = this;
|
|
430
|
+
for (var ent in entity) {
|
|
431
|
+
if(!ent.startsWith("_")){
|
|
432
|
+
if(!entity[ent].foreignKey){
|
|
433
|
+
if(entity[ent].relationshipTable){
|
|
434
|
+
if($that.chechUnsupportedWords(entity[ent].relationshipTable)){
|
|
435
|
+
entitiesList.push(`'${entity[ent].relationshipTable}'`);
|
|
436
|
+
}
|
|
437
|
+
else{
|
|
438
|
+
entitiesList.push(entity[ent].relationshipTable);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
else{
|
|
433
442
|
if($that.chechUnsupportedWords(ent)){
|
|
434
443
|
entitiesList.push(`'${ent}'`);
|
|
435
444
|
}
|
|
@@ -437,16 +446,26 @@ class SQLLiteEngine {
|
|
|
437
446
|
entitiesList.push(ent);
|
|
438
447
|
}
|
|
439
448
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
449
|
+
}
|
|
450
|
+
else{
|
|
451
|
+
|
|
452
|
+
if(entity[ent].relationshipType === "belongsTo"){
|
|
453
|
+
var name = entity[ent].foreignKey;
|
|
454
|
+
if($that.chechUnsupportedWords(name)){
|
|
455
|
+
entitiesList.push(`'${name}'`);
|
|
456
|
+
//entitiesList.push(`'${ent}'`);
|
|
457
|
+
}
|
|
458
|
+
else{
|
|
459
|
+
entitiesList.push(name);
|
|
460
|
+
//entitiesList.push(ent);
|
|
443
461
|
}
|
|
444
462
|
}
|
|
463
|
+
|
|
445
464
|
}
|
|
446
465
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
466
|
+
}
|
|
467
|
+
return entitiesList
|
|
468
|
+
}
|
|
450
469
|
chechUnsupportedWords(word){
|
|
451
470
|
for (var item in this.unsupportedWords) {
|
|
452
471
|
var text = this.unsupportedWords[item];
|
package/context.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version 0.0.
|
|
1
|
+
// Version 0.0.8
|
|
2
2
|
|
|
3
3
|
var modelBuilder = require('./Entity/entityModelBuilder');
|
|
4
4
|
var query = require('masterrecord/QueryLanguage/queryMethods');
|
|
@@ -91,6 +91,9 @@ class context {
|
|
|
91
91
|
|
|
92
92
|
__findSettings(root, rootFolderLocation, envType){
|
|
93
93
|
|
|
94
|
+
if(envType === undefined){
|
|
95
|
+
envType = "development";
|
|
96
|
+
}
|
|
94
97
|
var rootFolder = `${root}/${rootFolderLocation}`;
|
|
95
98
|
var search = `${rootFolder}/**/*env.${envType}.json`;
|
|
96
99
|
var files = globSearch.sync(search, rootFolder);
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "masterrecord",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"commander": "^
|
|
5
|
-
"glob" : "^
|
|
4
|
+
"commander": "^13.1.0",
|
|
5
|
+
"glob" : "^11.0.1",
|
|
6
6
|
"deep-object-diff" : "^1.1.9",
|
|
7
|
-
"pg" : "^8.
|
|
8
|
-
"sync-mysql2" : "^1.0.
|
|
7
|
+
"pg" : "^8.14.1",
|
|
8
|
+
"sync-mysql2" : "^1.0.5",
|
|
9
9
|
"app-root-path": "^3.1.0"
|
|
10
10
|
},
|
|
11
|
-
"version": "0.1.
|
|
11
|
+
"version": "0.1.3",
|
|
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": {
|