UNPKG

sqlparser-devexpress

Version:

SQLParser is a JavaScript library that converts SQL `WHERE` clauses into a structured **Abstract Syntax Tree (AST)** and transforms them into DevExpress filter format. It removes inline parameters while preserving them as dynamic variables for flexible qu

15 lines (11 loc) 576 B
// export const LITERALS = ["number", "string", "null"]; // Define operator precedence for parsing expressions export const OPERATOR_PRECEDENCE = { "OR": 1, "AND": 2, "=": 3, "!=": 3, ">": 3, "<": 3, ">=": 3, "<=": 3, "IN": 3, "<>": 3, "LIKE": 3, "IS": 3, "BETWEEN": 3 }; // Regular expression to check for unsupported SQL patterns (like SELECT-FROM or JOIN statements) export const UNSUPPORTED_PATTERN = /\bSELECT\b.*\bFROM\b|\bINNER\s+JOIN\b/i; export const LOGICAL_OPERATORS = ['and', 'or']; export const LITERAL_TYPES = ["value", "placeholder"];