sqlparser-devexpress 2.2.0 → 2.2.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/{LISCENSE.md → LICENSE} +5 -5
- package/README.md +8 -9
- package/package.json +1 -1
- package/src/index.js +2 -2
package/{LISCENSE.md → LICENSE}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2025 Rohit Mahajan
|
|
4
4
|
|
|
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
9
9
|
copies of the Software, and to permit persons to whom the Software is
|
|
10
10
|
furnished to do so, subject to the following conditions:
|
|
11
11
|
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
14
|
|
|
15
15
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -11,6 +11,12 @@ SQLParser is a JavaScript library that converts SQL `WHERE` clauses into a struc
|
|
|
11
11
|
- **Short-Circuit Optimization**: By default, eliminates `value = value` expressions for DevExpress compatibility (can be disabled for performance optimization).
|
|
12
12
|
- **Separation of Concerns**: Generate AST once, then use it for multiple state updates.
|
|
13
13
|
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm install sqlparser-devexpress
|
|
18
|
+
```
|
|
19
|
+
|
|
14
20
|
## Example Workflow
|
|
15
21
|
|
|
16
22
|
### **Step 1: Input SQL**
|
|
@@ -68,8 +74,6 @@ The parser identifies placeholders within the SQL query and extracts them for dy
|
|
|
68
74
|
|
|
69
75
|
These extracted variables can be used to fetch the corresponding state values in the application. You can store them in a `Record<string, any>`, where the key is the placeholder name, and the value is the resolved data from the application's state.
|
|
70
76
|
|
|
71
|
-
|
|
72
|
-
|
|
73
77
|
### **Step 3: Convert AST to DevExpress Format**
|
|
74
78
|
|
|
75
79
|
```javascript
|
|
@@ -98,12 +102,6 @@ console.log("DevExpress Filter:", JSON.stringify(devexpressFilter, null, 2));
|
|
|
98
102
|
]
|
|
99
103
|
```
|
|
100
104
|
|
|
101
|
-
## Installation
|
|
102
|
-
|
|
103
|
-
```sh
|
|
104
|
-
npm install sqlparser-devexpress
|
|
105
|
-
```
|
|
106
|
-
|
|
107
105
|
## API Reference
|
|
108
106
|
|
|
109
107
|
### `convertSQLToAst(filterString, enableConsoleLogs = false)`
|
|
@@ -139,4 +137,5 @@ Contributions are welcome! Feel free to open issues or submit pull requests.
|
|
|
139
137
|
|
|
140
138
|
## License
|
|
141
139
|
|
|
142
|
-
MIT
|
|
140
|
+
MIT
|
|
141
|
+
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -16,8 +16,8 @@ export function convertSQLToAst(filterString, enableConsoleLogs = false) {
|
|
|
16
16
|
return parsedResult;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export function convertAstToDevextreme(ast,
|
|
20
|
-
return convertToDevExpressFormat({ ast,
|
|
19
|
+
export function convertAstToDevextreme(ast, state, enableShortCircuit = true) {
|
|
20
|
+
return convertToDevExpressFormat({ ast, resultObject: state, enableShortCircuit })
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
|