sqlparser-devexpress 2.3.8 → 2.3.9
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/package.json +1 -1
- package/src/core/converter.js +3 -3
- package/tests/parser.test.js +7 -9
package/package.json
CHANGED
package/src/core/converter.js
CHANGED
|
@@ -146,11 +146,11 @@ function DevExpressConverter() {
|
|
|
146
146
|
|
|
147
147
|
let comparison = [left, operatorToken, right];
|
|
148
148
|
|
|
149
|
-
//
|
|
149
|
+
// Last null because of special case when using dropdown it https://github.com/DevExpress/DevExtreme/blob/25_1/packages/devextreme/js/__internal/data/m_utils.ts#L18 it takes last value as null
|
|
150
150
|
if ((ast.left && isFunctionNullCheck(ast.left, true)) || (ast.value && isFunctionNullCheck(ast.value, false))) {
|
|
151
|
-
comparison = [[left, operatorToken, right], 'or', [left, operatorToken, null,
|
|
151
|
+
comparison = [[left, operatorToken, right], 'or', [left, operatorToken, null, { type: "ISNULL", defaultValue: (ast.left ?? ast.value).args[1]?.value }, null]];
|
|
152
152
|
} else if (ast.right && isFunctionNullCheck(ast.right, true)) {
|
|
153
|
-
comparison = [[left, operatorToken, right], 'or', [right, operatorToken, null,
|
|
153
|
+
comparison = [[left, operatorToken, right], 'or', [right, operatorToken, null, { type: "ISNULL", defaultValue: ast.right.args[1]?.value }, null]];
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
// Apply short-circuit evaluation if enabled
|
package/tests/parser.test.js
CHANGED
|
@@ -137,11 +137,11 @@ describe("Parser SQL to dx Filter Builder", () => {
|
|
|
137
137
|
expected: [
|
|
138
138
|
["SourceID", "=", 2],
|
|
139
139
|
"or",
|
|
140
|
-
["SourceID", "=", null,{ "defaultValue": 0, "type": "ISNULL"}],
|
|
140
|
+
["SourceID", "=", null, { "defaultValue": 0, "type": "ISNULL" }, null],
|
|
141
141
|
"or",
|
|
142
142
|
["SourceID", "=", 0],
|
|
143
143
|
"or",
|
|
144
|
-
["SourceID", "=", null,{ "defaultValue": 0, "type": "ISNULL"}]
|
|
144
|
+
["SourceID", "=", null, { "defaultValue": 0, "type": "ISNULL" }, null]
|
|
145
145
|
]
|
|
146
146
|
},
|
|
147
147
|
{
|
|
@@ -153,14 +153,14 @@ describe("Parser SQL to dx Filter Builder", () => {
|
|
|
153
153
|
[
|
|
154
154
|
["CompanyID", "=", 0],
|
|
155
155
|
"or",
|
|
156
|
-
["CompanyID", "=", null,{ "defaultValue": 0, "type": "ISNULL"}]
|
|
156
|
+
["CompanyID", "=", null, { "defaultValue": 0, "type": "ISNULL" }, null]
|
|
157
157
|
]
|
|
158
158
|
],
|
|
159
159
|
"and",
|
|
160
160
|
[
|
|
161
161
|
["IsSubdealer", "=", true],
|
|
162
162
|
"or",
|
|
163
|
-
["IsSubdealer", "=", null,{ "defaultValue": 0, "type": "ISNULL"}]
|
|
163
|
+
["IsSubdealer", "=", null, { "defaultValue": 0, "type": "ISNULL" }, null]
|
|
164
164
|
]
|
|
165
165
|
]
|
|
166
166
|
},
|
|
@@ -187,7 +187,7 @@ describe("Parser SQL to dx Filter Builder", () => {
|
|
|
187
187
|
expected: [
|
|
188
188
|
["TicketID", "=", 123],
|
|
189
189
|
"or",
|
|
190
|
-
["TicketID", "=", null,{ "defaultValue": 0, "type": "ISNULL"}]
|
|
190
|
+
["TicketID", "=", null, { "defaultValue": 0, "type": "ISNULL" }, null]
|
|
191
191
|
]
|
|
192
192
|
},
|
|
193
193
|
{
|
|
@@ -195,14 +195,12 @@ describe("Parser SQL to dx Filter Builder", () => {
|
|
|
195
195
|
expected: [
|
|
196
196
|
["CompanyID", "=", 7],
|
|
197
197
|
"or",
|
|
198
|
-
["CompanyID", "=", null,{ "defaultValue": 0, "type": "ISNULL"}],
|
|
198
|
+
["CompanyID", "=", null, { "defaultValue": 0, "type": "ISNULL" }, null],
|
|
199
199
|
"or",
|
|
200
200
|
["CompanyID", "=", 0],
|
|
201
201
|
"or",
|
|
202
|
-
["CompanyID", "=", null,{ "defaultValue": 0, "type": "ISNULL"},
|
|
202
|
+
["CompanyID", "=", null, { "defaultValue": 0, "type": "ISNULL" }, null]
|
|
203
203
|
|
|
204
|
-
]
|
|
205
|
-
|
|
206
204
|
]
|
|
207
205
|
},
|
|
208
206
|
{
|