Closed coeit closed 2 years ago
Split into two operators: str_contains
and arr_contains
or something similar.
Write integration tests to ensure the outlined behavior. Make sure, the Zendro documentation is up to date.
If necessary split into two operators, regexp
and fullRegexp
or something similar.
Implement the like
operator for the storages, that do not have it but have regexp
using regexp as like.
Depending on the storage of the data model, in the schema define available operator lists. For generic data models use the SQL standard. Note in the Zendro manual that the programmer (Zendro user) needs to look into this.
all
operatorInvestigate what id does and in what storages it is supported, please
Most likely this is a "Karteileiche" and needs to be removed.
Summary
This issue aims at standardizing and documenting the use of search operators in the zendro graphql schema. Currently there is little to no information on the operators exposed, what they implement and how to use them. Furthermore some operators need to be standardized for different storage types.
List of operators
Currently the following operators are exposed by default through the graphql schema.
Fill out the table below and add it to the Zendro API Documentation. Also have a look at the postgres operators and the sequelize documentation (Section
Operators
)for more details.Also have a look at the spa models utility for a list of operators for each storageType.
If there are limitations to the storageType (e.g. cassandra doesn't support
like
) we do that in one of two possible implementations:CassandraOperator
,Neo4jOperator
, ...search-argument
if not supportedOperators that need to be standardized / looked at
like
Like searches are a way of pattern matching supported by
sql
,presto
andamazonS3
. The standard here is to use%
for multiple (or none) wildcard characters and_
for exactly one wildcard character.To unify the behaviour regardless of the storageType we can implement it in
neo4j
andmongodb
ourselves usingregex
. This is needed in case the model is remote and the user is not aware of the remote storageType. In case of distributed data-models alike
search should work regardless of the storageTypes, if supported.regexp / notRegexp
Regex and notRegexp searches are supported by
sql
,neo4j
andmongodb
.contains
Currently contains has different implementations depending on the storageType. It can be either an array contains or a string contains. This needs to be standardized, probably by offering an
arrayContains
andstringContains
. The latter could be implemented via like / regex. We can also just offercontains
for arrays and if a user wants to do a stringcontains
he/she can uselike
orregexp
.Make sure that the
contains
on arrays and thein
operator are well defined and used correctly. Whilecontains
filters on array columns given a scalar value,in
is the exact opposite and filters on scalar columns given an array.contained
In postgres
contained
implements a filter for subset of an array column. Investigate if this is implemented for other storageTypes.