mythix-orm 1.4.1 → 1.4.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.
|
@@ -860,8 +860,9 @@ class QueryGeneratorBase {
|
|
|
860
860
|
return `SUM(${escapedFieldName})`;
|
|
861
861
|
}
|
|
862
862
|
|
|
863
|
+
// eslint-disable-next-line no-unused-vars
|
|
863
864
|
toConnectionString(queryEngine, options) {
|
|
864
|
-
return
|
|
865
|
+
return '<not supported by connection>';
|
|
865
866
|
}
|
|
866
867
|
}
|
|
867
868
|
|
|
@@ -4,16 +4,21 @@ const Nife = require('nife');
|
|
|
4
4
|
const ProxyClass = require('../proxy-class');
|
|
5
5
|
const QueryEngineBase = require('./query-engine-base');
|
|
6
6
|
|
|
7
|
-
function addOperatorToQuery(name, inverseName, value) {
|
|
7
|
+
function addOperatorToQuery(name, inverseName, value, extraOptions) {
|
|
8
8
|
if (Nife.instanceOf(value, 'object'))
|
|
9
9
|
throw new Error(`QueryEngine::addOperatorToQuery: ${name}(${value}) makes no sense...`);
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
let conditionalParams = {
|
|
12
12
|
condition: true,
|
|
13
13
|
operator: name,
|
|
14
14
|
inverseOperator: inverseName,
|
|
15
15
|
value: this._fetchOperatorValue(value),
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
if (extraOptions)
|
|
19
|
+
conditionalParams = Object.assign(conditionalParams, extraOptions);
|
|
20
|
+
|
|
21
|
+
this._addToQuery(conditionalParams);
|
|
17
22
|
|
|
18
23
|
return this._fetchScope('model');
|
|
19
24
|
}
|
|
@@ -29,9 +34,6 @@ class FieldScope extends QueryEngineBase {
|
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
toString(...args) {
|
|
32
|
-
if (args.length === 0)
|
|
33
|
-
return `${this.constructor.name} {}`;
|
|
34
|
-
|
|
35
37
|
return this.currentContext.queryEngineScope.toString(...args);
|
|
36
38
|
}
|
|
37
39
|
|
|
@@ -86,12 +88,14 @@ class FieldScope extends QueryEngineBase {
|
|
|
86
88
|
return addOperatorToQuery.call(this, 'LTE', 'GT', value);
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
LIKE(value) {
|
|
90
|
-
|
|
91
|
+
LIKE(value, options) {
|
|
92
|
+
let caseSensitive = ((options && options.caseSensitive) === true);
|
|
93
|
+
return addOperatorToQuery.call(this, 'LIKE', 'NOT_LIKE', value, { caseSensitive });
|
|
91
94
|
}
|
|
92
95
|
|
|
93
|
-
NOT_LIKE(value) {
|
|
94
|
-
|
|
96
|
+
NOT_LIKE(value, options) {
|
|
97
|
+
let caseSensitive = ((options && options.caseSensitive) === true);
|
|
98
|
+
return addOperatorToQuery.call(this, 'NOT_LIKE', 'LIKE', value, { caseSensitive });
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
[ProxyClass.MISSING](target, prop) {
|