eaze / tide-sqlx

Tide middleware for SQLx pooled connections & transactions
https://crates.io/crates/tide-sqlx
Other
40 stars 9 forks source link

WIP unsafe nested transactions #10

Open Fishrock123 opened 3 years ago

Fishrock123 commented 3 years ago

This is... certainly risky, but it does work.

That being said, I am not sure it is really memory-safe as per this patch. Rustc doesn't complain but I am pretty sure the borrow we are extending has to be pinned to ensure the original context's memory doesn't get re-positioned. Not 100% sure but pretty sure. Can't hurt for safety. Just requires me put another couple hours at it.