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 of additional ESCAPE option for Oracle and MSSQL support to prevent empty results #971

Open
Ragnaroe opened this issue May 17, 2023 · 1 comment

Comments

@Ragnaroe
Copy link

First of all I'm new to github and not that experienced with the processes here.
The query builder is a great tool and I would like to address issues this has with the wildcard characters _ and % when the queries formed by the query builder are submitted to an Oracle or MSSQL Server DBMS.
So while the like operators, e.g. "contains" will have the wildcards escaped to _ and % but without the additional specification of the ESCAPE character it will not work in Oracle and MSSQL in my environment.
E.g.: name LIKE '%TEST_%' would have to be converted as follows: name LIKE '%TEST_%' ESCAPE '' to find "TEST_TEST"
This would be also compatible with PostGreSQL.

For building the sql, I would add the following lines at the line 5968 in query-buider.standalone.js:

if (rule.operator == 'begins_with' || rule.operator == 'not_begins_with' || rule.operator == 'contains' || rule.operator == 'not_contains' || rule.operator == 'ends_with' || rule.operator == 'not_ends_with') {
                                value += " ESCAPE '\\'"
}

However, the adjustment in the sqlparser is missing to be able to interpret this ESCAPE '' statement again.
Is there any chance that this will be addressed by you?

@sKUZZLEbut1808
Copy link

Got the same issue.
Any update on that?
Would be really helpful

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