- pub fn read_local(conn: &mut PgConnection) -> Result<Self, Error> {
- use crate::schema::site::dsl::*;
- site.order_by(id).first::<Self>(conn)
- }
-
- pub fn upsert(conn: &mut PgConnection, site_form: &SiteForm) -> Result<Site, Error> {
- use crate::schema::site::dsl::*;
- insert_into(site)
- .values(site_form)
- .on_conflict(actor_id)
- .do_update()
- .set(site_form)
- .get_result::<Self>(conn)
- }
-