From d7a7389afc4ad76181a1258cd45e8f19c5b9b0e0 Mon Sep 17 00:00:00 2001 From: amtoaer Date: Thu, 28 Mar 2024 19:53:24 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B5=8B=E8=AF=95=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=88=90=E5=8A=9F=20join=20=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/utils.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/core/utils.rs b/src/core/utils.rs index 7107357..443cf4e 100644 --- a/src/core/utils.rs +++ b/src/core/utils.rs @@ -190,3 +190,22 @@ pub async fn unhandled_videos_pages( .all(connection) .await?) } + +#[cfg(test)] +mod test { + use entity::{page, video}; + use sea_orm::{ColumnTrait, EntityTrait, QueryFilter}; + + #[ignore = "just for manual test"] + #[tokio::test] + async fn test_join() { + let video_with_pages: Vec<(video::Model, Vec)> = video::Entity::find() + .filter(video::Column::Handled.eq(false)) + .filter(video::Column::SinglePage.eq(false)) + .find_with_related(page::Entity) + .all(&crate::database::database_connection().await.unwrap()) + .await + .unwrap(); + dbg!(video_with_pages); + } +}