https://github.com/xbsoftware/querysql-node
Generate SQL query from json configuration
https://github.com/xbsoftware/querysql-node
webix-query
Last synced: 5 months ago
JSON representation
Generate SQL query from json configuration
- Host: GitHub
- URL: https://github.com/xbsoftware/querysql-node
- Owner: xbsoftware
- License: mit
- Created: 2020-04-21T12:46:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-15T09:42:24.000Z (almost 5 years ago)
- Last Synced: 2025-09-22T04:38:17.326Z (9 months ago)
- Topics: webix-query
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
JSON to SQL Query
==================
Converts JSON config to SQL Query
```json
{
"glue": "and",
"rules": [{
"field":"age",
"condition":{
"type": "less",
"filter": 42
}
},{
"field":"region",
"includes": [1,2,6]
}]
}
```
### Supported operations ( type )
- equal
- notEqual
- contains
- notContains
- lessOrEqual
- greaterOrEqual
- less
- notBetween
- between
- greater
- beginsWith
- notBeginsWith
- endsWith
- notEndsWith
### nesting
Blocks can be nested like next
```json
{
"glue": "and",
"rules": [
ruleA,
{
"glue": "or",
"rules": [
ruleC,
ruleD
]
}
]
}
```
### between / notBetween
For those operations, both start and end values can be provided
```json
{
"field":"age",
"condition":{
"type": "between",
"filter": { "start": 10, "end": 99 }
}
}
```
if only *start* is provided the operation will automatically change to *less* (notBetween) or *greaterOrEqual* (between)
if only *end* is provided the operation will automatically change to *greater* (notBetween) or *lessOrEqual* (between)