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 this.generateSelectStatement(queryEngine, options);
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
- this._addToQuery({
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
- return addOperatorToQuery.call(this, 'LIKE', 'NOT_LIKE', value);
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
- return addOperatorToQuery.call(this, 'NOT_LIKE', 'LIKE', value);
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) {
@@ -43,9 +43,6 @@ class ModelScope extends QueryEngineBase {
43
43
  }
44
44
 
45
45
  toString(...args) {
46
- if (args.length === 0)
47
- return `${this.constructor.name} {}`;
48
-
49
46
  return this.currentContext.queryEngineScope.toString(...args);
50
47
  }
51
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mythix-orm",
3
- "version": "1.4.1",
3
+ "version": "1.4.4",
4
4
  "description": "ORM for Mythix framework",
5
5
  "main": "lib/index.js",
6
6
  "type": "commonjs",