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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sqlparser-devexpress",
3
- "version": "2.3.12",
3
+ "version": "2.3.13",
4
4
  "main": "src/index.js",
5
5
  "type": "module",
6
6
  "scripts": {
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"];
@@ -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 === "value" && ast.value?.type === "value") {
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