Updated the 'QuerySelect' trait to expose 'lock_with_behavior' (#1867)

This commit is contained in:
Francis Le Roy 2024-01-14 16:51:51 +01:00 committed by GitHub
parent 3b0896b527
commit 7eb3e12294
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,8 +3,8 @@ use crate::{
PrimaryKeyToColumn, RelationDef, PrimaryKeyToColumn, RelationDef,
}; };
use sea_query::{ use sea_query::{
Alias, ConditionType, Expr, Iden, IntoCondition, IntoIden, LockType, SeaRc, SelectExpr, Alias, ConditionType, Expr, Iden, IntoCondition, IntoIden, LockBehavior, LockType, SeaRc,
SelectStatement, SimpleExpr, TableRef, SelectExpr, SelectStatement, SimpleExpr, TableRef,
}; };
pub use sea_query::{Condition, ConditionalStatement, DynIden, JoinType, Order, OrderedStatement}; pub use sea_query::{Condition, ConditionalStatement, DynIden, JoinType, Order, OrderedStatement};
@ -447,6 +447,14 @@ pub trait QuerySelect: Sized {
self self
} }
/// Row locking with behavior (if supported).
///
/// See [`SelectStatement::lock_with_behavior`].
fn lock_with_behavior(mut self, r#type: LockType, behavior: LockBehavior) -> Self {
self.query().lock_with_behavior(r#type, behavior);
self
}
/// Add an expression to the select expression list. /// Add an expression to the select expression list.
/// ``` /// ```
/// use sea_orm::sea_query::Expr; /// use sea_orm::sea_query::Expr;