sqlx
sqlx copied to clipboard
feat(postgres): remove lifetime from `PgAdvisoryLockGuard`
This is a breaking change.
Unlike with CPU synchronization primitives, there is no semantic requirement that the guard borrows the lock object.
We preserve the optimization of memoizing the release query by wrapping it in an Arc. This way all instances of PgAdvisoryLockGuard that originate from the same lock will share a single instance of the release query.
Does your PR solve an issue?
fixes #3429