This repository was archived by the owner on Mar 21, 2025. It is now read-only.
Prisma enum generation broken #197
Closed
Description
When using a prisma enum, the generated rust code includes an E0412 error.
Prisma enum example:
model Thing {
id Int @id
kind ThingKind
}
enum ThingKind {
Foo
Bar
Creature
}
The generated rust enum in _prisma > read_filters
gives a cannot find type ThingKind in this scope not found in this scope rustc(E0412)
error.
pub enum ThingKindFilter {
InVec(Vec<ThingKind>),
NotInVec(Vec<ThingKind>),
Not(ThingKind),
}
Adding use crate::prisma::ObjectKind;
above the rust enum, per the compiler suggestion, fixes the issue.