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

Let infer_schema also infer associations #335

Closed
weiznich opened this Issue May 18, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@weiznich
Contributor

weiznich commented May 18, 2016

infer_schema could also try to infer some associations from foreign key constrains and add the corresponding implementations of JoinTo.

For example the following case:

CREATE TABLE A(id SERIAL PRIMARY KEY, b_id INTEGER REFERENCES B(id));

It should be possible to let the macro implement the following association(or something similar to this):

joinable!(a -> b (b_id));

This could probably be implemented after the release of diesel 1.0, but keep in mind it could be a minor breaking if you implement this relation already manually.

@Eijebong

This comment has been minimized.

Member

Eijebong commented Aug 9, 2017

I think this one can be closed now that #1070 and #1077 have landed.

@Eijebong Eijebong closed this Aug 9, 2017

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