Implement on_conflict_clause::SupportsOnConflictClause
when using #[derive(diesel::MultiConnection)]
#4515
stormshield-gt
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
That would be indeed nice to have those impls. PR's for this are definitively welcome, otherwise I fear for me personally that's just nothing I can currently spend time on. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I tried to implement it but it's quite hard. I'm working with an #[derive(diesel::MultiConnection)]
enum AnyConnection {
Postgresql(diesel::PgConnection),
Sqlite(diesel::SqliteConnection),
} And I've added this to the macro #[derive(Debug, Copy, Clone)]
pub struct AnyConnectionSupportOnConflict;
// sqlite supports less than Pg, we support only what sqlite supports
impl diesel::backend::sql_dialect::on_conflict_clause::SupportsOnConflictClause
for AnyConnectionSupportOnConflict
{
}
impl diesel::backend::sql_dialect::on_conflict_clause::PgLikeOnConflictClause
for AnyConnectionSupportOnConflict
{
} Then I suppose I should implement |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It would be really nice if
#[derive(diesel::MultiConnection)]
implementedon_conflict_clause::SupportsOnConflictClause
if each variant of the enum supports it.Right now, if we have
The macro expension will do
Beta Was this translation helpful? Give feedback.
All reactions