diesel-rs / diesel

A safe, extensible ORM and Query Builder for Rust
https://diesel.rs
Apache License 2.0
12.79k stars 1.08k forks source link

Expose last_insert_id from Ok packet on MySQL #4271

Open mcronce opened 2 months ago

mcronce commented 2 months ago

Took a whack at implementing what we discussed in https://github.com/diesel-rs/diesel/discussions/3605 (finally); I'm sure I need to add some documentation at minimum.

Notably, I copied most of the body of execute_returning_id() from execute_returning_count(), not sure if that's how you want to handle that or not

Might have overabstracted; I implemented it using traits for extensibility.

I'll have a follow-up in diesel_async once this is merged.

mcronce commented 2 months ago

I don't think that that test failure has anything to do with my changes?