-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Support (Inbuilt)[] - Value type missmatch with iterator over elements, equals equation (where param) codegen #50
Comments
Ah, looks like I haven't added a |
Commit eg. SetParam::SetAtkLevels(value) => ("ATKLevels".to_string(), converter), <-- this converter value is not made |
|
this partially fixes it, To explain more i get 2 errors for any schema item with the type [] that are inbuilt types (not other tables). SetParam::SetPossibleValuesFormat(value) => {
("possibleValuesFormat".to_string(), converter) // <-- the converter here is not in scope, and i cannot find it, thinking it has just not been created?
}
SetParam::PushPossibleValuesFormat(value) => (
"possibleValuesFormat".to_string(),
QueryValue::Object(
vec![("push".to_string(), PrismaValue::String(value).into())] // <-- Getting error two below, type missmatch
.into_iter()
.collect(),
),
), Error 1:
Error 2:
|
Error 1 is me being silly and forgetting a # Error 2 is lists not being treated properly Try |
Much closer now, Had to use commit
Still getting issues with Error 2 listed above, expecting non vec in generated code. |
I haven't been able to replicate Error 2. Can you please provide a schema that generates the invalid code? |
Hi i was able to reproduce it with a modified example schema. generator client {
provider = "cargo prisma"
output = "../src/prisma.rs"
}
// Array primitives only available in postgresql
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id
updatedAt DateTime @default(now()) @updatedAt
displayName String
usernames String[] // These few lines generate the issues
ids Int[] // This one does too
floats Float[] // This one too
bools Boolean[] // This one too
jsons Json[] // This one is fine
posts Post[] // This is normal
}
model Post {
id String @id
content String
user User @relation(fields: [userId], references: [id])
userId String
}
|
@yoroshikun I think I got it in |
@Brendonovich This looks like it solved this issue! |
First of all, thanks for working on this project!
I seem to be getting a pretty generic value type mismatch in the generated prisma -> rust codegen
These errors pretty much exclusively appear under the equals equation something like
Edit
Almost immediately after posting this i noticed the correlation. Seems to happen on
Inbuilt[]
types such asString[] | Float[] | int[]
etcHave reflected it in the title
The text was updated successfully, but these errors were encountered: