summaryrefslogblamecommitdiffstats
path: root/src/artist.rs
blob: 0ea913154458a5637034949e9271b9f98c062c00 (plain) (tree)
1
2
3
4
5
6


                        
                                    
                   
                           






                             











                                            
     
 
use crate::error::Error;
use crate::Result;

#[derive(sqlx::FromRow, sqlx::Type)]
pub struct Artist {
    artist_id: Option<i32>,
    pub handle: String,
    pub name: Option<String>,
    pub bio: Option<String>,
    pub site: Option<String>,
}

impl Artist {
    pub fn new(handle: String) -> Self {
        Self {
            artist_id: None,
            handle,
            name: None,
            bio: None,
            site: None,
        }
    }

    pub fn artist_id(&self) -> Option<i32> {
        self.artist_id
    }
}