dbgate-filterparser 4.4.0-alpha.1 → 4.4.2
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/lib/filterTool.js +4 -0
- package/lib/parseFilter.js +2 -1
- package/package.json +3 -3
package/lib/filterTool.js
CHANGED
|
@@ -11,6 +11,10 @@ function getFilterValueExpression(value, dataType) {
|
|
|
11
11
|
return 'NULL';
|
|
12
12
|
if ((0, dbgate_tools_1.isTypeDateTime)(dataType))
|
|
13
13
|
return (0, moment_1.default)(value).format('YYYY-MM-DD HH:mm:ss');
|
|
14
|
+
if (value === true)
|
|
15
|
+
return 'TRUE';
|
|
16
|
+
if (value === false)
|
|
17
|
+
return 'FALSE';
|
|
14
18
|
return `="${value}"`;
|
|
15
19
|
}
|
|
16
20
|
exports.getFilterValueExpression = getFilterValueExpression;
|
package/lib/parseFilter.js
CHANGED
|
@@ -214,6 +214,7 @@ const createParser = (filterType) => {
|
|
|
214
214
|
nextYear: r => r.next.then(r.year).map(fixedMomentIntervalCondition('year', 1)),
|
|
215
215
|
eq: r => (0, common_1.word)('=').then(r.value).map(binaryCondition('=')),
|
|
216
216
|
ne: r => (0, common_1.word)('!=').then(r.value).map(binaryCondition('<>')),
|
|
217
|
+
ne2: r => (0, common_1.word)('<>').then(r.value).map(binaryCondition('<>')),
|
|
217
218
|
lt: r => (0, common_1.word)('<').then(r.value).map(binaryCondition('<')),
|
|
218
219
|
gt: r => (0, common_1.word)('>').then(r.value).map(binaryCondition('>')),
|
|
219
220
|
le: r => (0, common_1.word)('<=').then(r.value).map(binaryCondition('<=')),
|
|
@@ -233,7 +234,7 @@ const createParser = (filterType) => {
|
|
|
233
234
|
allowedValues.push('string1', 'string2', 'noQuotedString');
|
|
234
235
|
if (filterType == 'number')
|
|
235
236
|
allowedValues.push('string1Num', 'string2Num', 'number');
|
|
236
|
-
const allowedElements = ['null', 'notNull', 'eq', 'ne'];
|
|
237
|
+
const allowedElements = ['null', 'notNull', 'eq', 'ne', 'ne2'];
|
|
237
238
|
if (filterType == 'number' || filterType == 'datetime')
|
|
238
239
|
allowedElements.push('lt', 'gt', 'le', 'ge');
|
|
239
240
|
if (filterType == 'string')
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.4.
|
|
2
|
+
"version": "4.4.2",
|
|
3
3
|
"name": "dbgate-filterparser",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"typings": "lib/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"lib"
|
|
14
14
|
],
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"dbgate-types": "^4.4.
|
|
16
|
+
"dbgate-types": "^4.4.2",
|
|
17
17
|
"@types/jest": "^25.1.4",
|
|
18
18
|
"@types/node": "^13.7.0",
|
|
19
19
|
"jest": "^24.9.0",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@types/parsimmon": "^1.10.1",
|
|
25
|
-
"dbgate-tools": "^4.4.
|
|
25
|
+
"dbgate-tools": "^4.4.2",
|
|
26
26
|
"lodash": "^4.17.21",
|
|
27
27
|
"moment": "^2.24.0",
|
|
28
28
|
"parsimmon": "^1.13.0"
|