-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Feature : derive(Insertable) into multiple tables #1314
Comments
Ironically this used to work, but was removed when Since this is not a feature that will require a breaking change, it is on hold until after 1.0. |
Thanks for the response. #[derive(Insertable)] |
I tried that as well before finding this issue. Seems reasonable to me. |
I think that API is decent, but it has a few problems. The biggest one is that not all of our derives can handle more than one table ( I'm fine with not being able to derive Master is currently tracking 2.0, so we can technically make this change if we want (though it'd need a proposal on discourse following the template like all other breaking changes), but the big question is whether it's worth it. All our derives that look at |
Any update on this? :) |
@Boscop We are happy to receive a fully formulated feature request for this, otherwise as always: There is no update on an issue as the issue contains no update. That won't change by asking there, so please do ask such questions. |
@weiznich I'm willing to take a stab on this. In light of the upcoming 2.0 release, is there a preferred way of defining multiple table names (attribute list vs multiple attributes vs something else) as long as we have the chance to make breaking changes? If not then I'd go for the attribute list |
@toxeus The blocking issue here is to figure out how this interacts with other derives that use the table name. How the attribute should look like is a rather minor question. |
I see, multiple derive macros share the same |
@toxeus I think I would be fine with the following approach: We allow both: Either
|
..is it possible to achieve this in the current version if implementing |
I'm currently trying to use the same struct in many tables and was looking for something like this:
#[derive(Insertable)]
#[table_name="table1", "table2"]
instead of having to make separate structs for each table. Keep up the good work!
The text was updated successfully, but these errors were encountered: