diesel
diesel copied to clipboard
Compilation with `infer_schema!` panics when table has column named `ops`
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.
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.
FWIW I just ran into this but with a column named builder
.
I don't think you're running into this issue. Diesel doesn't have any types or modules called builder
.
Huh... ok then, I've split the builder
thing off into https://github.com/diesel-rs/diesel/issues/934.
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 https://github.com/diesel-rs/diesel/blob/6b4013d5e65fc4d988257afec403ad7db00882fa/diesel/src/macros/mod.rs#L275 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 https://github.com/diesel-rs/diesel/commit/b95c9d2b0d78dbe597ade51f35dcee4130235399, correct?