| ... | ... | @@ -64,6 +64,25 @@ WHERE ( me.name = me.label ) |
|
|
|
WHERE ( me.name like ? )
|
|
|
|
WHERE ( me.name not like ? )
|
|
|
|
```
|
|
|
|
|
|
|
|
## Regex
|
|
|
|
|
|
|
|
The regex operators (`~`, `!~`, `~*`, `!~*`) are supported:
|
|
|
|
|
|
|
|
`POST /data/system/entity/query`
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"conds" : {"me.name" : {"~*": "module.name"}}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
```sql
|
|
|
|
WHERE ( me.name ~* ? )
|
|
|
|
```
|
|
|
|
|
|
|
|
If a column on a big table is not indexed correctly, this search option will not be allowed.
|
|
|
|
|
|
|
|
## (not) IN
|
|
|
|
|
|
|
|
Search for a list of values.
|
| ... | ... | @@ -77,11 +96,12 @@ Search for a list of values. |
|
|
|
|
|
|
|
# IronAPI Extensions
|
|
|
|
|
|
|
|
# -in_function
|
|
|
|
## -in_function
|
|
|
|
|
|
|
|
This is an extension for IronAPI.
|
|
|
|
|
|
|
|
Instead of defining an array of ids for the "in" statement, get an array of ids from a function. This will only work if the function used has explicitly been listed as permitted for this.
|
|
|
|
Instead of defining an array of ids for the "in" statement, get an array of ids from a function.
|
|
|
|
This will only work if the function used has explicitly been listed as permitted for this.
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
| ... | ... | @@ -97,23 +117,7 @@ Instead of defining an array of ids for the "in" statement, get an array of ids |
|
|
|
"me.id" IN (SELECT * FROM core.assignment_ids_for_unit_instance(12))
|
|
|
|
```
|
|
|
|
|
|
|
|
# Regex
|
|
|
|
|
|
|
|
The regex operators (`~`, `!~`, `~*`, `!~*`) are supported:
|
|
|
|
|
|
|
|
```json
|
|
|
|
#/data/system/entity/query
|
|
|
|
|
|
|
|
"conds" : {"me.name" : {"~*": "module.name"}}
|
|
|
|
```
|
|
|
|
|
|
|
|
```sql
|
|
|
|
WHERE ( me.name ~* ? )
|
|
|
|
```
|
|
|
|
|
|
|
|
If a column on a big table is not indexed correctly, this search option will not be allowed.
|
|
|
|
|
|
|
|
# Similarity
|
|
|
|
## -similarity
|
|
|
|
|
|
|
|
This is an extension for IronAPI.
|
|
|
|
|
| ... | ... | @@ -139,17 +143,19 @@ This will be translated to sql `ORDER BY me.name <-> ? : "constant"`. |
|
|
|
|
|
|
|
If a column on a big table is not indexed correctly, this search option will not be allowed.
|
|
|
|
|
|
|
|
# tsquery
|
|
|
|
## -tsquery
|
|
|
|
|
|
|
|
This is an extension for IronAPI.
|
|
|
|
|
|
|
|
The attrs are just for reference, they are not needed for the search query!
|
|
|
|
It uses Postgres' fulltext search with [tsvecor and tsquery](https://www.postgresql.org/docs/14/datatype-textsearch.html).
|
|
|
|
|
|
|
|
To search for "data" within the names of entites, which we know are written in "english":
|
|
|
|
|
|
|
|
`POST /data/system/entity/query`
|
|
|
|
|
|
|
|
```json
|
|
|
|
#/data/system/entity/query
|
|
|
|
{
|
|
|
|
"conds" : {"-tsquery" : ["english","me.name","data"] },
|
|
|
|
"attrs" : {"+select" : "to_tsquery('english',me.name)", "+as" : "tsquery_name"}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
| ... | ... | |