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

C-style escapes in SQLite #3870

Closed
ckristo opened this issue May 21, 2015 · 0 comments
Closed

C-style escapes in SQLite #3870

ckristo opened this issue May 21, 2015 · 0 comments

Comments

@ckristo
Copy link

ckristo commented May 21, 2015

Hi,

I recently experienced a problem with a custom CGridView filter that allows to filter email addresses using partial matching. The filter wasn't working when an underscore character ('_') was present in the filter condition. After investigating a bit, I found out that SQLite doesn't support C-style escaping (cf. https://www.sqlite.org/lang_expr.html) which is used by Yii's DBAL by default (e.g. by CDbCriteria.addSearchCondition or by CDbCommandBuilder.createSearchCondition). In SQLite, you need to extend the LIKE expression by an ESCAPE clause (cf. http://stackoverflow.com/a/7323498).

There's a custom CDbCommandBuilder implementation for SQLite which could be easily adapted / extended, but not for CDbCriteria. Any idea how we could solve this there?

@ckristo ckristo changed the title C-like escapes in SQLite C-style escapes in SQLite May 21, 2015
@samdark samdark closed this as completed Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants