use diesel::prelude::*; use super::super::schema::{languages, langandagents}; #[derive(diesel_derive_enum::DbEnum, Debug, Clone, PartialEq, Eq)] #[DieselTypePath = "crate::db::schema::sql_types::Release"] pub enum Release { Public, NonCommercial, Research, Private } #[derive(diesel_derive_enum::DbEnum, Debug, Clone, PartialEq, Eq)] #[DieselTypePath = "crate::db::schema::sql_types::Dictgenre"] pub enum DictGenre { General, Learning, Etymology, Specialized, Historical, Orthography, Terminology } #[derive(diesel_derive_enum::DbEnum, Debug, Clone, PartialEq, Eq)] #[DieselTypePath = "crate::db::schema::sql_types::Agentlanguagerelation"] pub enum AgentLanguageRelation { Publisher, Author } #[derive(Queryable, Insertable, Debug, Clone, PartialEq, Eq)] pub struct Language { release: Release, created: chrono::NaiveDateTime, name: String, owner: String, targetlanguage: Vec, genre: Vec, native: Option, abstract_: Option, description: Option, rights: Option, license: Option, } #[derive(Queryable, Insertable, Debug, Clone, PartialEq, Eq)] #[diesel(table_name = langandagents)] pub struct LangAndAgent { id: i32, agent: String, language: String, }