use diesel::prelude::*;

#[derive(Queryable, Selectable)]
#[diesel(table_name = crate::schema::rss_feeds)]
#[diesel(check_for_backend(diesel::sqlite::Sqlite))]
pub struct RssFeed {
    pub id: i32,
    pub name: String,
    pub feed_url: String,
    pub last_pub_date: Option<String>,
}


#[derive(Insertable)]
#[diesel(table_name = crate::schema::rss_feeds)]
pub struct NewRssFeed<'a> {
    pub name: &'a str,
    pub feed_url: &'a str,
}