You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the getting started page on Diesel's docs the schema.rs file is typically automatically created/updated by diesel setup or diesel migration run.
The problem is that the schema.rs that it generates does not include the proper Mapping suffix for enum types. This results in errors similar to this.
I am able to work around this issue by adding a patch_file to diesel.toml, but I would prefer to avoid this.
The text was updated successfully, but these errors were encountered:
Yes, this is definitely annoying and I myself came up against it this week. However, it is a result of how Diesel chooses to mangle the names of types it does not recognize - it uses Title_case i.e. foo -> Foo but foo_bar -> Foo_bar. There is no consistent way to map this to the type this crate generates.
I think the real solution would be to offer a PR to Diesel to allow you to specify the name mangling rule in your diesel.toml. However I haven't really thought about how this might work.
As a workaround, if you make sure your enums are always TwoWords then you can use #[DieselType = "Two_words"] and it should work, or else use a patch file as you suggested.
You could also try re-exporting the mapping types in a different modules, as described in #53 . That allows you to alias the mapping types to whatever diesel expects them to be.
According to the getting started page on Diesel's docs the
schema.rs
file is typically automatically created/updated bydiesel setup
ordiesel migration run
.The problem is that the
schema.rs
that it generates does not include the properMapping
suffix for enum types. This results in errors similar to this.I am able to work around this issue by adding a
patch_file
to diesel.toml, but I would prefer to avoid this.The text was updated successfully, but these errors were encountered: