sqlparser-devexpress 2.3.12 → 2.3.13
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/constants.js +3 -1
- package/src/core/converter.js +2 -2
package/package.json
CHANGED
package/src/constants.js
CHANGED
|
@@ -10,4 +10,6 @@ export const OPERATOR_PRECEDENCE = {
|
|
|
10
10
|
// Regular expression to check for unsupported SQL patterns (like SELECT-FROM or JOIN statements)
|
|
11
11
|
export const UNSUPPORTED_PATTERN = /\bSELECT\b.*\bFROM\b|\bINNER\s+JOIN\b/i;
|
|
12
12
|
|
|
13
|
-
export const LOGICAL_OPERATORS = ['and', 'or'];
|
|
13
|
+
export const LOGICAL_OPERATORS = ['and', 'or'];
|
|
14
|
+
|
|
15
|
+
export const LITERAL_TYPES = ["value", "placeholder"];
|
package/src/core/converter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LOGICAL_OPERATORS } from "../constants.js";
|
|
1
|
+
import { LITERAL_TYPES, LOGICAL_OPERATORS } from "../constants.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Main conversion function that sets up the global context
|
|
@@ -207,7 +207,7 @@ function DevExpressConverter() {
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
// handle short circuit evaluation for IN operator
|
|
210
|
-
if (EnableShortCircuit && ast.field?.type
|
|
210
|
+
if (EnableShortCircuit && (LITERAL_TYPES.includes(ast.field?.type) && LITERAL_TYPES.includes(ast.value?.type))) {
|
|
211
211
|
const fieldVal = convertValue(ast.field);
|
|
212
212
|
if (Array.isArray(resolvedValue)) {
|
|
213
213
|
// normalize numeric strings if LHS is number
|