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

🚀 Feature: Contains for SQL(MariaDB/MySQL/SQLite) adapter #360

Open
2 tasks done
mattie-cmsp opened this issue Nov 22, 2023 · 0 comments
Open
2 tasks done

🚀 Feature: Contains for SQL(MariaDB/MySQL/SQLite) adapter #360

mattie-cmsp opened this issue Nov 22, 2023 · 0 comments

Comments

@mattie-cmsp
Copy link

🔖 Feature description

The SQL adapter including Maria/MySQL/SQLite should support the Contains query. I.E. attribute LIKE '%something%'

🎤 Pitch

Forgive me if I missed it somewhere, but I don't see any reason that the SQL connector doesn't already support "Contains" queries. The syntax is well know, supported by all 3 supported SQL engines(and most others), and simple and consistent across all versions of SQL.

So far as I can tell, this would only require changing 1 line of code to provide support, and one or two others to enable that support(instead of rejecting it).

src/Database/Adapter/SQL.php -> bindConditionValue, add:

Query::TYPE_CONTAINS => '%' . $this->escapeWildcards($value) . '%',

Please let me know if there is a reason this isn't already done. It seems so obvious that I can't help but think there is a reason it's not already done, and that I'm the one missing something obvious.

If needed, I'd be happy to clone, modify, and submit a PR.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

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

1 participant