Skip to content

Generate ENUM fields as python Enum types or string Literal typesΒ #408

@sheinbergon

Description

@sheinbergon

Things to check first

  • I have searched the existing issues and didn't find my feature already requested there

Feature description

Today, enum fields are generated as str columns. I'd like bind them to generated native python Enum or string Literals instead.

Use case

This would greatly ease the use of native RDBMs enums in the code, providing tough constraints (python Enum) or soft hints (Literal), and will help prevent human errors when developing against generated sqlacodegen models

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions