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

Prisma enum generation broken #197

Closed
styxpilled opened this issue Nov 2, 2022 · 2 comments
Closed

Prisma enum generation broken #197

styxpilled opened this issue Nov 2, 2022 · 2 comments
Labels
bug Something isn't working generator

Comments

@styxpilled
Copy link

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.

@Brendonovich Brendonovich added bug Something isn't working generator labels Nov 2, 2022
@Brendonovich Brendonovich added this to the 0.6.4 milestone Nov 6, 2022
@Brendonovich
Copy link
Owner

@styxpilled @codemaster138 can you try using rev = "a0fb19d25d6869c6398a338e5228d80c81a8c354" and see if it fixes the problem? It's not a complete nice fix but it should get the job done for now.

@codemaster138
Copy link

@Brendonovich yeah, that seems to have fixed the issue. Thanks for handling this so quickly!

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

No branches or pull requests

3 participants