Skip to content

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

Open
@Goldziher

Description

@Goldziher

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):
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions