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

Generate Custom Types for certain Columns from tables #65

Open
DhineshKrishnan2 opened this issue Aug 6, 2024 · 1 comment
Open

Generate Custom Types for certain Columns from tables #65

DhineshKrishnan2 opened this issue Aug 6, 2024 · 1 comment

Comments

@DhineshKrishnan2
Copy link

DhineshKrishnan2 commented Aug 6, 2024

I have a enum type defined in my column of a table.when i use diesel_ext > src/models.rs I ran into a issue of {MyEnumType} is not recognized. Please feel free to expand the HashMap.This could provide good hints: https://kotiri.com/2018/01/31/postgresql-diesel-rust-types.html is there any way to allow the custom types.There's no problem in generating schema as it finds the enum and creates some Empty structs for enums.Later i can use diesel-derive-enums for working with enums

@draagc
Copy link

draagc commented Aug 8, 2024

The workaround I've used is the --map option to specify which rust type it is (which is itself, generated by diesel print-schema) like so: diesel_ext --map {MyEnumType} {MyEnumType}. This could be done automatically, might work on this and raise a PR when I get some time.

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

2 participants