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
I have several instances of this pattern:
Table foo has a column that's TEXT NOT NULL, but it represents an enum in Rust, which is serialized as string in pg.
So the previous handwritten model struct contained an enum type for this field, but diesel_ext will generate String for it (of course).
In another similar use case, there is a typesafe newtype wrapper around a String field, which should be used in the model struct.
With the -M flag there is no way to override it, only to map ALL such types to another.
Please allow specifying custom Rust types for model fields, like: --type "foo.bar MyEnum" --type "foo.baz MyStringWrapper".
That would be awesome, and one step closer to fully generated models.
The text was updated successfully, but these errors were encountered:
I have several instances of this pattern:
Table
foo
has a column that'sTEXT NOT NULL
, but it represents an enum in Rust, which is serialized as string in pg.So the previous handwritten model struct contained an enum type for this field, but
diesel_ext
will generateString
for it (of course).In another similar use case, there is a typesafe newtype wrapper around a String field, which should be used in the model struct.
With the
-M
flag there is no way to override it, only to map ALL such types to another.Please allow specifying custom Rust types for model fields, like:
--type "foo.bar MyEnum" --type "foo.baz MyStringWrapper"
.That would be awesome, and one step closer to fully generated models.
The text was updated successfully, but these errors were encountered: