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

`table!` fails when column name is named `bool` #1204

Open
Emilgardis opened this Issue Sep 26, 2017 · 5 comments

Comments

Projects
None yet
4 participants

Emilgardis added a commit to Emilgardis/diesel that referenced this issue Sep 26, 2017

@sgrif sgrif changed the title from `infer_schema!` fails when column name is a rust type. to `table!` fails when column name is named `bool` Jan 17, 2018

@sgrif

This comment has been minimized.

Member

sgrif commented Jan 17, 2018

Just to make sure this has up to date context:

The issue is limited only to columns called bool. The problem is in the code generated by #[derive(QueryId)], where there is an associated const with the type bool. The solution to this is to have a type alias somewhere known (it actually doesn't even have to be in Diesel, we can just put it in the generated code), and reference that instead of bool directly. Eventually the language will provide std::primitives::bool, and we can change to referencing that when it lands in stable.

@sgrif

This comment has been minimized.

Member

sgrif commented Jan 17, 2018

This is a low priority bug, so I'm leaving it off the milestone. Happy to help a new contributor work on a patch though

@stevepentland

This comment has been minimized.

stevepentland commented Feb 19, 2018

In an effort to learn more about diesel, I'd like to take this one on @sgrif. I'm just looking through what I believe is the code you referenced in your previous comment.

@sgrif

This comment has been minimized.

Member

sgrif commented Feb 19, 2018

👍 Feel free to ask in Gitter if you have questions.

@YetAnotherMinion

This comment has been minimized.

Contributor

YetAnotherMinion commented Feb 20, 2018

Related, the column name nodes also causes the table macro to fail. One of diesel's internal modules is named nodes and that causes an ambiguous import error when the table macro is expanded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment