File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -718,6 +718,35 @@ pub trait QueryFilter: Sized {
718
718
/// );
719
719
/// ```
720
720
///
721
+ /// Like above, but using the `IN` operator.
722
+ ///
723
+ /// ```
724
+ /// use sea_orm::{entity::*, query::*, tests_cfg::cake, DbBackend};
725
+ ///
726
+ /// assert_eq!(
727
+ /// cake::Entity::find()
728
+ /// .filter(cake::Column::Id.is_in([4, 5]))
729
+ /// .build(DbBackend::MySql)
730
+ /// .to_string(),
731
+ /// "SELECT `cake`.`id`, `cake`.`name` FROM `cake` WHERE `cake`.`id` IN (4, 5)"
732
+ /// );
733
+ /// ```
734
+ ///
735
+ /// Like above, but using the `ANY` operator. Postgres only.
736
+ ///
737
+ /// ```
738
+ /// use sea_orm::{entity::*, query::*, tests_cfg::cake, DbBackend};
739
+ /// use sea_orm::sea_query::{Expr, extension::postgres::PgFunc};
740
+ ///
741
+ /// assert_eq!(
742
+ /// cake::Entity::find()
743
+ /// .filter(Expr::col((cake::Entity, cake::Column::Id)).eq(PgFunc::any(vec![4, 5])))
744
+ /// .build(DbBackend::Postgres)
745
+ /// .to_string(),
746
+ /// r#"SELECT "cake"."id", "cake"."name" FROM "cake" WHERE "cake"."id" = ANY(ARRAY [4,5])"#
747
+ /// );
748
+ /// ```
749
+ ///
721
750
/// Add a runtime-built condition tree.
722
751
/// ```
723
752
/// use sea_orm::{entity::*, query::*, tests_cfg::cake, DbBackend};
You can’t perform that action at this time.
0 commit comments