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! errors when column is the same name with the table it contains #624
Comments
ivanceras
changed the title from
Error when column is the same name with the table it contains
to
infer_schema! errors when column is the same name with the table it contains
Feb 5, 2017
This comment has been minimized.
|
I think the specific source of this error is likely the mod $table_name {
pub struct table;
mod columns {
// ...
}
mod dsl {
pub use super::table as $table_name;
pub use super::columns::*;
}
}In theory we could just skip generating the dsl module if there's a column with the same name as the table. That is potentially even more confusing than an error though. If nothing else, giving a more helpful error message is certainly the easiest thing to do here. |
killercup
added
bug
good first issue
help wanted
labels
Feb 11, 2017
This comment has been minimized.
|
Hm. To solve this, you'll either need to
|
added a commit
to notryanb/diesel
that referenced
this issue
Sep 18, 2017
notryanb
referenced this issue
Sep 18, 2017
Merged
Generate compile time error for table! double import #1175
added a commit
to notryanb/diesel
that referenced
this issue
Sep 19, 2017
added a commit
to notryanb/diesel
that referenced
this issue
Sep 20, 2017
sgrif
closed this
in
#1175
Sep 20, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ivanceras commentedFeb 5, 2017
•
edited
Table which has a column name same to the table such as
will error with:
A workaround is to simply not use a column with the same name as the table, such as
This is a minor issue, but the rust error message is a bit misleading.