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
JsonNullableFilter type is wrong #297
Comments
This is an interesting one... Turns out Prisma's null handling is way more complex than I expected. Making |
Ok, so Prisma Client JS deals with nulls by exposing an enum like this, since it only has one pub enum JsonNullValueFilter {
DbNull,
JsonNull,
AnyNull,
} But Rust has both |
I've half-fixed this on c235317 - |
Temporary fix that has worked for me is to set a default value instead: model some_model {
id String @id @unique @db.Uuid
some_column Json @default("[]")
} Is this the only workaround until your fix is released? |
I guess so, I haven't explored any workarounds myself |
Hit this issue as well (and switched to model Predictions {
id String @id @default(uuid())
input Json
metrics Json?
output Json @default("{}")
webhookFilter WebhookEvent[]
} #[derive(Debug, Clone)]
pub enum SetParam {
Id(super::_prisma::write_params::StringParam),
Input(super::_prisma::write_params::JsonParam),
Output(super::_prisma::write_params::JsonParam),
} |
I have this same issue. @m1guelpf by chance, what sha did you reference when you switched to main? Code gen via the CLI on the latest main seems to be broken. |
@matthewgapp rev |
I wrote a model using the
Json?
type in schema.prisma and did a cargo prisma generate.The generated code looks like the following, which is a compile error because it cannot accept Option.
The text was updated successfully, but these errors were encountered: