5 user::{UserSafe, User_},
9 use diesel::{result::Error, *};
12 #[derive(Debug, Serialize, Clone)]
15 pub creator: UserSafe,
19 pub fn read(conn: &PgConnection) -> Result<Self, Error> {
20 let (site, creator) = site::table
21 .inner_join(user_::table)
22 .select((site::all_columns, User_::safe_columns_tuple()))
23 .first::<(Site, UserSafe)>(conn)?;
25 Ok(SiteView { site, creator })