Possible bug in Querying operators: `$iLike` triggering error when `$like` works.
See original GitHub issueI’ve the following code:
query.where[param].$iLike = '%' + options.req.query.filter[param] + '%';
to make a dynamic searching, but is triggering the following error:
error: { [SequelizeDatabaseError: SQLITE_ERROR: near "ILIKE": syntax error]
name: 'SequelizeDatabaseError',
message: 'SQLITE_ERROR: near "ILIKE": syntax error',
parent:
{ [Error: SQLITE_ERROR: near "ILIKE": syntax error]
errno: 1,
code: 'SQLITE_ERROR',
sql: 'SELECT `id`, `name`, `legal_name`, `color`, `logo`, `full_logo`, `banner`, `notes`, `created_at`, `updated_at`, `deleted_at`, `hierarchy_level`, `parent_id` FROM `Organizations` AS `Organization` WHERE (`Organization`.`deleted_at` IS NULL AND `Organization`.`name` ILIKE \'%x%\') LIMIT 10;' },
original:
{ [Error: SQLITE_ERROR: near "ILIKE": syntax error]
errno: 1,
code: 'SQLITE_ERROR',
sql: 'SELECT `id`, `name`, `legal_name`, `color`, `logo`, `full_logo`, `banner`, `notes`, `created_at`, `updated_at`, `deleted_at`, `hierarchy_level`, `parent_id` FROM `Organizations` AS `Organization` WHERE (`Organization`.`deleted_at` IS NULL AND `Organization`.`name` ILIKE \'%x%\') LIMIT 10;' },
sql: 'SELECT `id`, `name`, `legal_name`, `color`, `logo`, `full_logo`, `banner`, `notes`, `created_at`, `updated_at`, `deleted_at`, `hierarchy_level`, `parent_id` FROM `Organizations` AS `Organization` WHERE (`Organization`.`deleted_at` IS NULL AND `Organization`.`name` ILIKE \'%x%\') LIMIT 10;' }
If I change $iLike for $like it works like a charm.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to use iLike operator with Sequelize to make case ...
I would like to perform a case insensitive search query. When I googled it up, some people said that I can use "iLike"...
Read more >Documentation: 11: E.13. Release 11.6 - PostgreSQL
This mistake caused the planner to treat too much of the pattern as being a fixed prefix, so that indexscans derived from an...
Read more >Update #7002 fails on postgres - ILIKE operator on bytea not ...
I just experienced a similar issue upgrading form 7.01: Failed: PDOException: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not ...
Read more >Error and Transaction Handling in SQL Server Part Two
This is a bug in SqlClient which is not able to cope with datetimeoffset data in an sql_variant value. You don't get this...
Read more >QuerySet API reference | Django documentation
A QuerySet is iterable, and it executes its database query the first time you ... Passing different models works as long as the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

And like is case insensitive in sqlite by default 😃 http://sqlite.org/faq.html#q18
iLike is only supported by postgres