1 use crate::schema::community_aggregates;
2 use diesel::{result::Error, *};
5 #[derive(Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Clone)]
6 #[table_name = "community_aggregates"]
7 pub struct CommunityAggregates {
15 impl CommunityAggregates {
16 pub fn read(conn: &PgConnection, id: i32) -> Result<Self, Error> {
17 community_aggregates::table.find(id).first::<Self>(conn)
21 // TODO add unit tests, to make sure triggers are working