Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upinfer_schema! fails when field is `type` and maybe other reserved Rust keywords #342
Comments
This comment has been minimized.
|
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. |
This comment has been minimized.
|
I think having a renaming convention would be a good idea for the Also, note that the |
kardeiz
referenced this issue
Sep 2, 2016
Closed
`table` macro that allows remapping table and field names #424
killercup
referenced this issue
Aug 9, 2017
Merged
Add a way to rename a column in the table! macro #1084
Eijebong
referenced this issue
Aug 16, 2017
Merged
Automatically rename columns which name would collide with a keyword #1110
This comment has been minimized.
Eijebong
closed this
Aug 24, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mkroman commentedMay 24, 2016
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.