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

Error parsing enums during generate #1350

Closed
B3none opened this issue Sep 4, 2024 · 2 comments
Closed

Error parsing enums during generate #1350

B3none opened this issue Sep 4, 2024 · 2 comments
Assignees

Comments

@B3none
Copy link

B3none commented Sep 4, 2024

I'm running: go run github.com/steebchen/prisma-client-go generate

This enum:

enum ServerOS {
  Unknown // corresponds to ServerOS_Unknown
  Linux // corresponds to ServerOS_Linux
  Windows // corresponds to ServerOS_Windows
  Mac // corresponds to ServerOS_Mac
}

Seems to be getting changed in the db_gen.go to ServerOs and it's causing me the following errors:

# my-lovely-project/db
db/db_gen.go:753:23: undefined: ServerOs
db/db_gen.go:4894:52: undefined: ServerOs
db/db_gen.go:4914:55: undefined: ServerOs
db/db_gen.go:4929:65: undefined: ServerOs
db/db_gen.go:4945:56: undefined: ServerOs
db/db_gen.go:4954:53: undefined: ServerOs
db/db_gen.go:4968:62: undefined: ServerOs
db/db_gen.go:4975:56: undefined: ServerOs
db/db_gen.go:4989:65: undefined: ServerOs
db/db_gen.go:4996:52: undefined: ServerOs
db/db_gen.go:4996:52: too many errors

At the minute I have a workaround, but I have to put this in a build step:

# Ensure db/db_gen.go is present and then apply the sed command to replace all occurrences
RUN if [ -f db/db_gen.go ]; then sed -i 's/ServerOs/ServerOS/g' db/db_gen.go; else echo "db/db_gen.go not found"; exit 1; fi
@steebchen steebchen self-assigned this Sep 4, 2024
@steebchen
Copy link
Owner

Thanks, fixed via #1359 and release in v0.41.0

@B3none
Copy link
Author

B3none commented Sep 12, 2024

Thanks, fixed via #1359 and release in v0.41.0

Awesome thank you! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants