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 upBe more generic over tables #537
Comments
This comment has been minimized.
|
We may add support for multiple tables in the future, but for the time being the best way to handle this is going to be to implement Example implementation: struct SomeForm {
field1: String,
field2: String,
}
impl<'a> Insertable<table1::table> for &'a SomeForm {
type Values = <(Eq<table1::field1, &'a str>, Eq<table1::field2, &'a str>) as Insertable<table1::table>>::Values;
fn values(&self) -> Self::Values {
(table1::field1.eq(&self.field1), table2::field2.eq(&self.field2)).values()
}
}I think you're right that |
sgrif
closed this
Dec 16, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jethrogb commentedDec 9, 2016
•
edited
I have multiple tables that have the exact same schema. I'd like to be able to write code that's generic over such tables. I'm running into some issues: