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

Weird types when batching FindMany #208

Closed
codemaster138 opened this issue Nov 16, 2022 · 3 comments · Fixed by #211
Closed

Weird types when batching FindMany #208

codemaster138 opened this issue Nov 16, 2022 · 3 comments · Fixed by #211
Labels
bug Something isn't working lib

Comments

@codemaster138
Copy link

I'm working on a server that uses Prisma Client Rust to interact with its database. One of its endpoints needs to run multiple find_many queries, so I'm trying to batch them into a single request. My code looks something like this:

use crate::prisma::my_object::{Data, FindMany};

let db: &PrismaClient = todo!();

let queries: (FindMany, FindMany) = todo!();

let results = db
	._batch(queries)
	.await
	.unwrap(); 

Now, I would expect results to be a tuple with one item corresponding to each item in queries and containing a Vec<Data> since each FindMany query should return a Vec<Data>.

However, the actual type of results is (Data, Data).

Is my code wrong, or is this another code generation bug?

@Brendonovich Brendonovich added bug Something isn't working lib labels Nov 16, 2022
@Brendonovich
Copy link
Owner

Not a codegen bug but a library bug, is an easy fix

@Brendonovich Brendonovich added this to the 0.6.4 milestone Nov 17, 2022
@Brendonovich
Copy link
Owner

@codemaster138 should be fixed in rev = "999f772cfd4d5185b451ec8d5a018b2f5f7b17d7"

@Brendonovich Brendonovich linked a pull request Nov 18, 2022 that will close this issue
@codemaster138
Copy link
Author

Yep, seems to be working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants