Skip to content
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

Support Comparisons with RegEx #4

Open
hugobessa opened this issue Mar 9, 2022 · 7 comments
Open

Support Comparisons with RegEx #4

hugobessa opened this issue Mar 9, 2022 · 7 comments

Comments

@hugobessa
Copy link

Are there plans to support Comparisons with RegEx? Are PRs introducing this feature welcome?

@maxipavlovic
Copy link
Member

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?

@ghost
Copy link

ghost commented Mar 29, 2022

@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?

@maxipavlovic
Copy link
Member

I see your point @ffaraoneim. I like the idea of support for filtering by Python regex in Python part.

@hugobessa
Copy link
Author

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

@hugobessa
Copy link
Author

What I mean is that it would make sense for lib-rql but also for django-rql

@maxipavlovic
Copy link
Member

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.

@maxipavlovic
Copy link
Member

@hugobessa CLA is now ready and automated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants