oxidecomputer / async-bb8-diesel

Safe asynchronous access to Diesel and the bb8 connection manager
MIT License
12 stars 8 forks source link

feat: implement async save change dsl #2

Closed mattsse closed 3 years ago

mattsse commented 3 years ago

This tries to fix the lifetime problem mentioned in #1.

It does so by basically copying all trait bounds and implementation over from UpdateAndFetchResults. There still some issues:

It should be possible however to come up with a solution that prevents at least the Clone, but the diesel traits are so intertwined that it's not trivial at first glance.

smklein commented 3 years ago

Hey, this is a great change! I created a variant of it here which simplifies trait bounds, and I think which aligns with the synchronous usage of SaveChangesDsl a little more closely.

What do you think?

mattsse commented 3 years ago

awesome, that looks great, the trait bounds were horrendous :)

closing this in favor of #3