masterrecord 0.0.23 → 0.0.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.
- package/Entity/EntityModel.js +128 -120
- package/Entity/EntityModelBuilder.js +63 -63
- package/Entity/EntityTrackerModel.js +42 -42
- package/Masterrecord.js +173 -178
- package/Migrations/cli.js +105 -105
- package/Migrations/migrationTemplate.js +63 -63
- package/Migrations/migrations.js +46 -22
- package/Migrations/schema.js +42 -42
- package/QueryLanguage/_Expression.js +321 -321
- package/QueryLanguage/_LogicalQuery.js +22 -22
- package/QueryLanguage/_OperatorList.js +87 -87
- package/QueryLanguage/_QueryModel.js +441 -441
- package/QueryLanguage/_Tokenization.js +172 -172
- package/QueryLanguage/__Query.js +385 -385
- package/QueryLanguage/_simpleQuery.js +183 -183
- package/QueryLanguage/queryBuilder.js +51 -51
- package/{SQLEngine.js → SQLiteEngine.js} +56 -52
- package/Tools.js +55 -55
- package/package.json +27 -27
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var Query = require('masterrecord/QueryLanguage/_simpleQuery');
|
|
4
|
-
|
|
5
|
-
class LogicalQuery {
|
|
6
|
-
constructor(context, modelName){
|
|
7
|
-
this.__model = context.__allContext[0].__name === modelName;
|
|
8
|
-
this.__query = new Query(this.__model, context);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
build(tokenQuery){
|
|
12
|
-
|
|
13
|
-
// we will run code to create new instances of the of the QueryModel and procss code
|
|
14
|
-
// where(r => r.name == "richard").single().flys.distinct().toList();
|
|
15
|
-
|
|
16
|
-
// loop thourgh and call all functions to build out the query;
|
|
17
|
-
return this.__query;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
var Query = require('masterrecord/QueryLanguage/_simpleQuery');
|
|
4
|
+
|
|
5
|
+
class LogicalQuery {
|
|
6
|
+
constructor(context, modelName){
|
|
7
|
+
this.__model = context.__allContext[0].__name === modelName;
|
|
8
|
+
this.__query = new Query(this.__model, context);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
build(tokenQuery){
|
|
12
|
+
|
|
13
|
+
// we will run code to create new instances of the of the QueryModel and procss code
|
|
14
|
+
// where(r => r.name == "richard").single().flys.distinct().toList();
|
|
15
|
+
|
|
16
|
+
// loop thourgh and call all functions to build out the query;
|
|
17
|
+
return this.__query;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
23
|
module.exports = LogicalQuery;
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
// List all operators and base them on collections and non collections
|
|
2
|
-
// we can use this to validate which operators can and can't be used
|
|
3
|
-
var OperatorList = {
|
|
4
|
-
where : {
|
|
5
|
-
type: "collection",
|
|
6
|
-
section: "condition",
|
|
7
|
-
returnType : "collection"
|
|
8
|
-
},
|
|
9
|
-
contains : {
|
|
10
|
-
type: "single",
|
|
11
|
-
returnType : "none"
|
|
12
|
-
},
|
|
13
|
-
skip : {
|
|
14
|
-
type: "collection",
|
|
15
|
-
returnType : "collection",
|
|
16
|
-
section: "limit"
|
|
17
|
-
},
|
|
18
|
-
take: {
|
|
19
|
-
type: "collection",
|
|
20
|
-
returnType : "collection"
|
|
21
|
-
},
|
|
22
|
-
last: {
|
|
23
|
-
type: "collection",
|
|
24
|
-
returnType : "single"
|
|
25
|
-
},
|
|
26
|
-
orderByDescending : {
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
orderBy : {
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
groupBy : {
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
union: {
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
find : {
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
except : {
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
any : {
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
select : {
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
distinct :{
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
count :{
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
average :{
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
sum : {
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
max : {
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
min : {
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
join : {
|
|
69
|
-
type: "collection",
|
|
70
|
-
returnType: "collection"
|
|
71
|
-
},
|
|
72
|
-
groupJoin :{
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
toArray : {
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
toDictionary : {
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
toList : {
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
single : {
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
1
|
+
// List all operators and base them on collections and non collections
|
|
2
|
+
// we can use this to validate which operators can and can't be used
|
|
3
|
+
var OperatorList = {
|
|
4
|
+
where : {
|
|
5
|
+
type: "collection",
|
|
6
|
+
section: "condition",
|
|
7
|
+
returnType : "collection"
|
|
8
|
+
},
|
|
9
|
+
contains : {
|
|
10
|
+
type: "single",
|
|
11
|
+
returnType : "none"
|
|
12
|
+
},
|
|
13
|
+
skip : {
|
|
14
|
+
type: "collection",
|
|
15
|
+
returnType : "collection",
|
|
16
|
+
section: "limit"
|
|
17
|
+
},
|
|
18
|
+
take: {
|
|
19
|
+
type: "collection",
|
|
20
|
+
returnType : "collection"
|
|
21
|
+
},
|
|
22
|
+
last: {
|
|
23
|
+
type: "collection",
|
|
24
|
+
returnType : "single"
|
|
25
|
+
},
|
|
26
|
+
orderByDescending : {
|
|
27
|
+
|
|
28
|
+
},
|
|
29
|
+
orderBy : {
|
|
30
|
+
|
|
31
|
+
},
|
|
32
|
+
groupBy : {
|
|
33
|
+
|
|
34
|
+
},
|
|
35
|
+
union: {
|
|
36
|
+
|
|
37
|
+
},
|
|
38
|
+
find : {
|
|
39
|
+
|
|
40
|
+
},
|
|
41
|
+
except : {
|
|
42
|
+
|
|
43
|
+
},
|
|
44
|
+
any : {
|
|
45
|
+
|
|
46
|
+
},
|
|
47
|
+
select : {
|
|
48
|
+
|
|
49
|
+
},
|
|
50
|
+
distinct :{
|
|
51
|
+
|
|
52
|
+
},
|
|
53
|
+
count :{
|
|
54
|
+
|
|
55
|
+
},
|
|
56
|
+
average :{
|
|
57
|
+
|
|
58
|
+
},
|
|
59
|
+
sum : {
|
|
60
|
+
|
|
61
|
+
},
|
|
62
|
+
max : {
|
|
63
|
+
|
|
64
|
+
},
|
|
65
|
+
min : {
|
|
66
|
+
|
|
67
|
+
},
|
|
68
|
+
join : {
|
|
69
|
+
type: "collection",
|
|
70
|
+
returnType: "collection"
|
|
71
|
+
},
|
|
72
|
+
groupJoin :{
|
|
73
|
+
|
|
74
|
+
},
|
|
75
|
+
toArray : {
|
|
76
|
+
|
|
77
|
+
},
|
|
78
|
+
toDictionary : {
|
|
79
|
+
|
|
80
|
+
},
|
|
81
|
+
toList : {
|
|
82
|
+
|
|
83
|
+
},
|
|
84
|
+
single : {
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
88
|
}
|