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

Changing order of Table structs shouldn't affect compilation #1518

Closed
allowthere opened this Issue Jan 31, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@allowthere

allowthere commented Jan 31, 2018

No description provided.

@sgrif

This comment has been minimized.

Member

sgrif commented Jan 31, 2018

Thanks, but this is the documented behavior of #[derive(Queryable)], and isn't something that will change any time soon. The type of a SQL query is represented as a tuple, which necessitates order dependence. Additionally, Queryable does not mean one-to-one with a row in a database table, meaning field names aren't particularly useful there.

If you don't want field order to be important, I recommend avoiding #[derive(Queryable)] and implementing the trait directly instead.

@sgrif sgrif closed this Jan 31, 2018

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