1 use crate::structs::SiteView;
2 use diesel::{result::Error, *};
4 aggregates::structs::SiteAggregates,
5 schema::{site, site_aggregates},
10 pub fn read_local(conn: &PgConnection) -> Result<Self, Error> {
11 let (mut site, counts) = site::table
12 .inner_join(site_aggregates::table)
13 .select((site::all_columns, site_aggregates::all_columns))
15 .first::<(Site, SiteAggregates)>(conn)?;
17 site.private_key = None;
18 Ok(SiteView { site, counts })