|
|
[[_TOC_]]
|
|
[[_TOC_]]
|
|
|
|
|
|
|
|
# NULL / NOT NULL
|
|
# DBIX::Class Inbuilts
|
|
|
|
|
|
|
|
## (not) NULL
|
|
|
|
|
|
|
|
To search for (not) NULL entries, use the null value in json:
|
|
To search for (not) NULL entries, use the null value in json:
|
|
|
|
|
|
|
|
```JSON
|
|
`POST /data/extensions/client_meta_data/query`
|
|
|
#/data/extensions/widget/query
|
|
|
|
|
|
|
|
|
|
{ "conds" : {"me.query" : null }}
|
|
```json
|
|
|
|
{
|
|
|
|
"conds": {
|
|
|
|
"me.api_key": null
|
|
|
|
}
|
|
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
```JSON
|
|
```json
|
|
|
#/data/extensions/widget/query
|
|
{
|
|
|
|
|
"conds": {
|
|
|
"conds" : {
|
|
"me.api_key": {
|
|
|
"me.query" : {
|
|
"-not": null
|
|
|
"-not" : null
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
# IDENT - comparing two columns
|
|
## IDENT - comparing two columns
|
|
|
|
|
|
|
|
```JSON
|
|
This query will return all entries where name=label.
|
|
|
#/data/system/entity/query
|
|
|
|
|
|
|
|
|
|
{ "conds" : {"me.name" : {"-ident": "module.name"}} }
|
|
`POST /data/system/entity/query`
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"conds": {
|
|
|
|
"me.name": {
|
|
|
|
"-ident": "me.label"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
```SQL
|
|
```sql
|
|
|
WHERE ( me.name = module.name )
|
|
WHERE ( me.name = me.label )
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
<http://search.cpan.org/~ilmari/SQL-Abstract-1.84/lib/SQL/Abstract.pm#-ident>
|
|
<http://search.cpan.org/~ilmari/SQL-Abstract-1.84/lib/SQL/Abstract.pm#-ident>
|
|
|
|
|
|
|
|
# LIKE and ILIKE
|
|
## LIKE and ILIKE
|
|
|
|
|
|
|
|
```JSON
|
|
`POST /data/system/entity/query`
|
|
|
#/data/system/entity/query
|
|
|
|
|
|
```json
|
|
|
|
#
|
|
|
{ "conds" : {"me.name" : {"-like": "%a%"}} }
|
|
{ "conds" : {"me.name" : {"-like": "%a%"}} }
|
|
|
{ "conds" : {"me.name" : {"-not_like": "%a%"}} }
|
|
{ "conds" : {"me.name" : {"-not_like": "%a%"}} }
|
|
|
{ "conds" : {"me.name" : {"-ilike": "%a%"}} }
|
|
{ "conds" : {"me.name" : {"-ilike": "%a%"}} }
|
|
|
{ "conds" : {"me.name" : {"-not_ilike": "%a%"}} }
|
|
{ "conds" : {"me.name" : {"-not_ilike": "%a%"}} }
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
```SQL
|
|
```sql
|
|
|
WHERE ( me.name like ? )
|
|
WHERE ( me.name like ? )
|
|
|
WHERE ( me.name not like ? )
|
|
WHERE ( me.name not like ? )
|
|
|
```
|
|
```
|
|
|
# (not) IN
|
|
## (not) IN
|
|
|
|
|
|
|
|
```JSON
|
|
Search for a list of values.
|
|
|
#/data/system/entity/query
|
|
|
|
|
|
`POST /data/system/entity/query`
|
|
|
|
|
|
|
|
```json
|
|
|
{ "conds" : {"me.name" : {"-in": [1,2]}} }
|
|
{ "conds" : {"me.name" : {"-in": [1,2]}} }
|
|
|
{ "conds" : {"me.name" : {"-not_in": [3,4]}} }
|
|
{ "conds" : {"me.name" : {"-not_in": [3,4]}} }
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
```SQL
|
|
# IronAPI Extensions
|
|
|
WHERE ( me.name in (?) )
|
|
|
|
|
WHERE ( me.name not in (?) )
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# -in_function
|
|
# -in_function
|
|
|
|
|
|
| ... | | ... | |