-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Combine query mode with operators #175
Comments
Thought I fixed this earlier but didn't apply it to |
The above code still does case sensitive search on |
Did you use that version for both the CLI and library and then regenerate the client? I tried it with Postgres on my machine and it works fine. |
I changed my prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "e44cae1e680e5b0a8f73f68fc99fc6c40066fb83" }
prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "e44cae1e680e5b0a8f73f68fc99fc6c40066fb83" } then ran the generate command. My actual code looks like this in case it makes a difference: pub async fn find(
Extension(db): Extension<Arc<PrismaClient>>,
Validated(Query(query)): Validated<Query<FindQuery>>,
) -> ApiResult<FindResponse> {
let mut params = vec![];
if let Some(search) = &query.search {
params.push(or!(
and!(
candidate::name::mode(crate::prisma::_prisma::QueryMode::Insensitive),
candidate::name::contains(search.clone()),
),
and!(
candidate::email::mode(crate::prisma::_prisma::QueryMode::Insensitive),
candidate::email::contains(search.clone()),
)
));
}
let candidates = db
.candidate()
.find_many(params.clone())
.take(query.limit)
.skip(query.offset)
.exec();
let count = db.candidate().count(params).exec();
let (candidates, count) = try_join!(candidates, count)?;
Ok(Json(FindResponse {
records: candidates,
query,
total_records: count,
}))
} note that I clone the params vec. |
My bad, I pointed you to the wrong commit. Try |
Works, thanks! |
I am trying to do a case insensitive search based on two different fields, however it doesn't seem to be working also can't find any docs on this. I tried the following but the search is still case sensitive:
It works fine if I just do it against one field with out the
or
s andand
s.The text was updated successfully, but these errors were encountered: