From: Dessalines Date: Thu, 24 Dec 2020 00:09:41 +0000 (-0500) Subject: Merge remote-tracking branch 'origin/split-db-workspace2' into move_views_to_diesel_s... X-Git-Url: http://these/git/%7B%24%7B%60data:application/static/%24%7Bargs.thread.url%7D?a=commitdiff_plain;h=4c681eb48b526dd8058792288ad3aac7570c3d89;p=lemmy.git Merge remote-tracking branch 'origin/split-db-workspace2' into move_views_to_diesel_split_2 --- 4c681eb48b526dd8058792288ad3aac7570c3d89 diff --cc lemmy_api/src/post.rs index f3589462,07a39732..4630918b --- a/lemmy_api/src/post.rs +++ b/lemmy_api/src/post.rs @@@ -33,6 -27,12 +27,15 @@@ use lemmy_db_schema:: post_report::{PostReport, PostReportForm}, }, }; + use lemmy_db_views::{ + comment_view::CommentQueryBuilder, + post_report_view::{PostReportQueryBuilder, PostReportView}, + post_view::{PostQueryBuilder, PostView}, + }; -use lemmy_db_views_actor::community_moderator_view::CommunityModeratorView; ++use lemmy_db_views_actor::{ ++ community_moderator_view::CommunityModeratorView, ++ community_view::CommunityView, ++}; use lemmy_structs::{blocking, post::*}; use lemmy_utils::{ apub::{make_apub_endpoint, EndpointType}, diff --cc lemmy_db_queries/src/lib.rs index 8e352147,b9dbc09d..44ea66c7 --- a/lemmy_db_queries/src/lib.rs +++ b/lemmy_db_queries/src/lib.rs @@@ -138,6 -137,13 +137,13 @@@ pub trait ToSafe fn safe_columns_tuple() -> Self::SafeColumns; } + pub trait ViewToVec { + type DbTuple; - fn to_vec(tuple: Vec) -> Vec ++ fn from_tuple_to_vec(tuple: Vec) -> Vec + where + Self: Sized; + } + pub fn get_database_url_from_env() -> Result { env::var("LEMMY_DATABASE_URL") } diff --cc lemmy_structs/src/post.rs index 0c6c23d7,0410b1b8..02dcf28a --- a/lemmy_structs/src/post.rs +++ b/lemmy_structs/src/post.rs @@@ -3,7 -3,7 +3,10 @@@ use lemmy_db_views:: post_report_view::PostReportView, post_view::PostView, }; -use lemmy_db_views_actor::community_moderator_view::CommunityModeratorView; ++use lemmy_db_views_actor::{ ++ community_moderator_view::CommunityModeratorView, ++ community_view::CommunityView, ++}; use serde::{Deserialize, Serialize}; #[derive(Deserialize, Debug)]