Case-insensitive filtering does not work
See original GitHub issueBug description
Case-insensitive filtering doesn’t work. Intellisense isn’t picking up any properties named ‘mode’ anywhere in the options for where. Error thrown is “Unknown arg ‘mode’”
How to reproduce
Enable the preview feature in schema.prisma and add mode: ‘insensitive’ to the query.
return await db.user.findMany({
where: {
name: { contains: userName, mode: 'insensitive' }, // throws error
// also fails inside of OR
OR: [
{
name: { contains: userQuery, mode: 'insensitive' }, // throws error
},
{
email: { contains: userQuery },
},
],
},
select: { email: true, id: true, name: true },
})
Expected behavior
Case-insensitive filtering should work.
Prisma information
It’s the latest version. I’ve enabled the preview feature in schema.prisma.
Environment & setup
- OS: macOS
- Database: PostgreSQL 13
- Node.js version: 14.10
- Prisma version: 2.7.1
@prisma/cli : 2.7.1
Current platform : darwin
Query Engine : query-engine 5c2ad460cf4fe8c9330e6640b266c046542c8b6a (at node_modules/@prisma/cli/query-engine-darwin)
Migration Engine : migration-engine-cli 5c2ad460cf4fe8c9330e6640b266c046542c8b6a (at node_modules/@prisma/cli/migration-engine-darwin)
Introspection Engine : introspection-core 5c2ad460cf4fe8c9330e6640b266c046542c8b6a (at node_modules/@prisma/cli/introspection-engine-darwin)
Format Binary : prisma-fmt 5c2ad460cf4fe8c9330e6640b266c046542c8b6a (at node_modules/@prisma/cli/prisma-fmt-darwin)
Studio : 0.288.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
ES6: Filter data with case insensitive term - javascript
This is how I filter some data ...
Read more >Case insensitive filter - Get Help - Metabase Discussion
If I run the raw SQL from Metabase, it produces the correct (case-insensitive) result. Any idea what could be going wrong here?
Read more >Case Insensitive Filtering Using Power Query - MyExcelOnline
Case Insensitive Filtering Using Power Query - Learn an easy way to do case insensitive filtering in Power Query with just a few...
Read more >Substring with case Insensitive filter is not working OData V4
Working on the filter options through ODataV4 endpoints. In the API I have a field name called Description and it has the value....
Read more >Need filter case insensitive - Appian Community
If your collation is case sensitive (and you can't change it to case insensitive), you might have to do a workaround like create...
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 FreeTop 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
Top GitHub Comments
I figured out what was going on. For some reason the datasource provider contained both sqlite and postgres. Removing sqlite so that just postgres remained solved the problem.
I filed this bug before 2.8.0 was released and took that screenshot on 2.7.1 with the feature flag enabled. Though I did upgrade to 2.8.0 and remove the previewFeature flag, the error remains.