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

Compilation with `infer_schema!` panics when table has column named `ops` #851

Open
Ameobea opened this Issue Apr 6, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@Ameobea

Ameobea commented Apr 6, 2017

Somewhere in the macro expansion, there is code that imports ops from within diesel. If a column in a database is named ops, this causes conflicts within the macro.

I think that putting a note somewhere that this could happen may be enough; however, prefixing the internal variables or module names to something like _table_ops or something similar would be a more permanent solution.

@sgrif

This comment has been minimized.

Member

sgrif commented Apr 7, 2017

It's coming from the glob import on diesel::types::*. diesel::types::ops is not internal, it's public API. we just need a more scoped import.

@sgrif sgrif added the bug label Apr 7, 2017

@alanhdu

This comment has been minimized.

alanhdu commented Jun 5, 2017

FWIW I just ran into this but with a column named builder.

@sgrif

This comment has been minimized.

Member

sgrif commented Jun 5, 2017

I don't think you're running into this issue. Diesel doesn't have any types or modules called builder.

@alanhdu

This comment has been minimized.

alanhdu commented Jun 5, 2017

Huh... ok then, I've split the builder thing off into #934.

@willmurphyscode

This comment has been minimized.

Contributor

willmurphyscode commented Feb 8, 2018

It's coming from the glob import on diesel::types::*. diesel::types::ops is not internal, it's public API. we just need a more scoped import.

I'd like to work on this but I could use a hand getting started.

Am I correct in thinking that

import = [$(use $($import:tt)::+;)*];
is where we need to import something more specific? What should the import be?

Also, it looks like we're looking for imports of diesel::sql_types::* now, since there aren't diesel::types any more, after b95c9d2, correct?

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