Skip to content

Major version #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ JSON to SQL Query

Converts JSON config to SQL Query

```json
```js
{
"glue": "and",
"rules": [{
"field": "age",
"filter": "less",
"value": 42
},{
"field": "region",
"includes": [1,2,6]
}]
"rules": [
{
"field": "age",
"filter": "less",
"value": 42
},
{
"field": "region",
"includes": [1,2,6]
}
]
}
```

Expand All @@ -38,7 +41,7 @@ Converts JSON config to SQL Query

Blocks can be nested like next

```json
```js
{
"glue": "and",
"rules": [
Expand All @@ -48,22 +51,25 @@ Blocks can be nested like next
"rules": [
ruleC,
ruleD
]
]
}
]
]
}
```

### between / notBetween

For those operations, both start and end values can be provided

```json
```js
{
"field":"age",
"filter": "between",
"value": { "start": 10, "end": 99 }
"field": "age",
"filter": "between",
"value": {
"start": 10,
"end": 99
}
}
```

if only *start* or *end* provided, the operation will change to *less* or *greater* automatically
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/xbsoftware/querysql
module github.com/xbsoftware/querysql/v2

go 1.13