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

Generated Enum names do not conform to either PascalCase or CamelCase #47

Open
Goldziher opened this issue Jun 7, 2024 · 0 comments
Open

Comments

@Goldziher
Copy link

Hi there,

Thanks for this plugin! I love sqlc and I'm excited to try it in python as well.

Without further ado, here is the issue. Given the following pgsql enums:

CREATE TYPE ProjectState AS ENUM ('PRE', 'AUDIT', 'POST', 'FINISHED');
CREATE TYPE DomainComplexity AS ENUM ('SIMPLE', 'MODERATE', 'COMPLEX', 'HIGHLY_COMPLEX');

I would expect the output to have the same name format. Instead what I am getting is this:

class Projectstate(str, enum.Enum):
    PRE = "PRE"
    AUDIT = "AUDIT"
    POST = "POST"
    FINISHED = "FINISHED"

class Domaincomplexity(str, enum.Enum):
    SIMPLE = "SIMPLE"
    MODERATE = "MODERATE"
    COMPLEX = "COMPLEX"
    HIGHLY_COMPLEX = "HIGHLY_COMPLEX"

Expected would be:

class ProjectState(str, enum.Enum):
    ...

class DomainComplexity(str, enum.Enum):
    ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant