1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
use ;
use crateSoftDelete;
/// Trash filters for any query on a [`SoftDelete`] entity.
///
/// ```
/// # mod posts {
/// # use sea_orm::entity::prelude::*;
/// # #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
/// # #[sea_orm(table_name = "posts")]
/// # pub struct Model {
/// # #[sea_orm(primary_key)]
/// # pub id: i32,
/// # pub category_id: i32,
/// # pub slug: String,
/// # pub deleted_at: Option<DateTimeWithTimeZone>,
/// # }
/// # #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
/// # pub enum Relation {}
/// # }
/// # impl sea_orm::ActiveModelBehavior for posts::ActiveModel {}
/// # impl sea_orm_soft_delete::SoftDelete for posts::Entity {
/// # fn deleted_at_column() -> Self::Column { posts::Column::DeletedAt }
/// # }
/// use sea_orm::{ColumnTrait, DatabaseConnection, DbErr, EntityTrait, QueryFilter};
/// use sea_orm_soft_delete::TrashedQuery;
///
/// async fn example(db: &DatabaseConnection) -> Result<(), DbErr> {
/// let posts = posts::Entity::find()
/// .filter(posts::Column::CategoryId.eq(1))
/// .without_trashed()
/// .all(db)
/// .await?;
/// Ok(())
/// }
/// # fn main() {}
/// ```
///
/// There is no `with_trashed()`: a plain query already includes trashed rows.