You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of now, if one wants to fetch a row using the FOR UPDATE SKIP LOCKED clauses, one need to write something that looks like that:
letmut select = Entity::find_by_id(id);QuerySelect::query(&mut select)// Many traits have the `query` method, so we need to differentiate here.// This returns a `&mut SelectStatement`, which cannot be chained with the implementors of `QuerySelect`.// So we have to write it on a separate line..lock_with_behavior(LockType::Update,LockBehavior::SkipLocked);
select
.one(conn).await
Proposed Solutions
This is a minor issue of course, but could be alleviated fairly easily by exposing the .lock_with_behavior directly from the QuerySelect trait.
A PR will follow to address this issue.
Current Workarounds
The attached example demonstrates the current workaround.
The text was updated successfully, but these errors were encountered:
Motivation
As of now, if one wants to fetch a row using the
FOR UPDATE SKIP LOCKED
clauses, one need to write something that looks like that:Proposed Solutions
This is a minor issue of course, but could be alleviated fairly easily by exposing the
.lock_with_behavior
directly from theQuerySelect
trait.A PR will follow to address this issue.
Current Workarounds
The attached example demonstrates the current workaround.
The text was updated successfully, but these errors were encountered: