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
Yeah, for now there's no way to have columns with the same name as keywords in Rust. I'm planning on having some renaming convention in the future, but haven't decided on what it should be. The underscore proposal sounds reasonable.
I think having a renaming convention would be a good idea for the infer_schema macro, but I think it would be nice to be able to explicitly specify the renaming/mapping using the table macro (something like column_name="type".
Also, note that the column_name field annotation for models also doesn't allow Rust keywords.
Hello.
When compiling with diesel, if a table has a field named
type
, the build will fail with the following error:It's possible that this problem also exists for other Rust keywords.
A reasonable solution could be suffixing the Rust field with
_
(i.e.type_
) for reserved keywords.The text was updated successfully, but these errors were encountered: