lib-rql
lib-rql copied to clipboard
Support Comparisons with RegEx
Are there plans to support Comparisons with RegEx? Are PRs introducing this feature welcome?
Hi, @hugobessa ! Sorry for a delayed response, we've missed somehow.
Anyway, there were no plans to support RegEx. For me it's hard to imagine cases, when RegEx search is an optimal solution for an API filter, do you have some? Also, I may be mistaken, but I think that various DB engines have different RegEx flavours, so it seems a hard task to solve generically.
Team @zzzevaka, @marcserrat, @ffaraoneim, what do you think?
@maxipavlovic you are right, regex syntax is DB dependent, it would be strange that an API consumer would know the DB engine behind the API. But for lib-rql perhaps it makes sense. What do you think?
I see your point @ffaraoneim. I like the idea of support for filtering by Python regex in Python part.
In theory, the __regex
lookup on Django converts from Python regex to a format that the database understands. That's what the documentation says, at least
What I mean is that it would make sense for lib-rql but also for django-rql
Frankly speaking, personally I wouldn't want to expand this further than python version only, as we are also thinking of adding parsing to https://github.com/cloudblue/javascript-rql and regular expressions seem to be different in Python / JS, at least according to this and somehow they could affect grammar.
IMHO, LIKE functionality seems to cover most of the cases in Django-RQL.
@hugobessa CLA is now ready and automated :)