1 use crate::schema::comment_aggregates;
2 use diesel::{result::Error, *};
5 #[derive(Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Clone)]
6 #[table_name = "comment_aggregates"]
7 pub struct CommentAggregates {
15 impl CommentAggregates {
16 pub fn read(conn: &PgConnection, comment_id: i32) -> Result<Self, Error> {
17 comment_aggregates::table
18 .filter(comment_aggregates::comment_id.eq(comment_id))
23 // TODO add tests here