Case insesitive query throws server error.
See original GitHub issuewhen running a case insensitive query the the following error is thrown:
Invalid `
prisma.make.findMany()` invocation:
{
where: {
name: {
equals: 'BMW',
mode: 'insensitive'
}
~~~~~~~~~~~~~~~~~~~~~
}
}
Argument name: Got invalid value
{
equals: 'BMW',
mode: 'insensitive'
}
on prisma.findManyMake. Provided Json, expected StringNullableFilter or String or Null.
To Reproduce
Runn the following query
query {
allMakes(where: { name_i: "BMW" }) {
name
models {
name
}
}
}
this also happens in code:
const res = await models.Make.findMany({
where: { name_i: make }
});
Expected behaviour
Return results
Screenshots
System information
- Keystone:
@keystone-next/keystone": "^14.0.1",
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Collation at server level is causing issues with case sensitivity ...
The issue I am running into now is that all variables in stored procedures must be case sensitive or else it will throw...
Read more >Error messages encountered due to case sensitive collation of ...
These error messages occurred after migrating a database to a SQL Server with a case-sensitive collation. The project database requires a ...
Read more >Case Insensitive Queries - Ask TOM
Is there a way to SELECT from a table in a case insensitive manner? For example, I want to execute: SELECT * FROM...
Read more >Case-insensitive pattern matching in PostgreSQL - CYBERTEC
We discuss the options for case-insensitive comparison and pattern matching in PostgreSQL, comparing the performance of different ...
Read more >SQL SERVER - Case Sensitive Database and Database User
SQL SERVER – Case Sensitive Database and Database User – Fix: Error: 15151 – Cannot find the user , because it does not...
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
@ashhitch Ah, I’ve just found the issue. The SQLite adapter does not support case insensitive search, due to limitations in SQLite itself. The
name_i
filter option should be disabled when running on SQLite (e.g. it shouldn’t exist in the schema at all)… I just found a bug in the code which is stopping this disable step from working, which is why you’re seeing it in your schema. I’m going to ship a fix for this in the next release 👍No worries. Good to hear that you’re going to do the SQLite -> PostgreSQL upgrade, that’s the graduation path that we’d expect most developers to take. SQLite is great for day 1 hacking, but the limitations make it worth making the step up to PostgreSQL worth it 👍