2 aggregates::site_aggregates::SiteAggregates,
3 schema::{site, site_aggregates, user_},
6 user::{UserSafe, User_},
10 use diesel::{result::Error, *};
13 #[derive(Debug, Serialize, Clone)]
16 pub creator: UserSafe,
17 pub counts: SiteAggregates,
21 pub fn read(conn: &PgConnection) -> Result<Self, Error> {
22 let (site, creator, counts) = site::table
23 .inner_join(user_::table)
24 .inner_join(site_aggregates::table)
27 User_::safe_columns_tuple(),
28 site_aggregates::all_columns,
30 .first::<(Site, UserSafe, SiteAggregates)>(conn)?;