//! SeaORM Entity. Generated by sea-orm-codegen 0.1.0

use sea_orm::entity::prelude::*;

#[derive(Copy, Clone, Default, Debug, DeriveEntity)]
pub struct Entity;

impl EntityName for Entity {
    fn table_name(&self) -> &str {
        "rust_keyword"
    }
}

#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)]
pub struct Model {
    pub id: i32,
    pub testing: i32,
    pub rust: i32,
    pub keywords: i32,
    pub r#type: i32,
    pub r#typeof: i32,
    pub crate_: i32,
    pub self_: i32,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
    Id,
    Testing,
    Rust,
    Keywords,
    Type,
    Typeof,
    Crate,
    Self_,
}

#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
    Id,
}

impl PrimaryKeyTrait for PrimaryKey {
    type ValueType = i32;

    fn auto_increment() -> bool {
        true
    }
}

#[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {}

impl ColumnTrait for Column {
    type EntityName = Entity;

    fn def(&self) -> ColumnDef {
        match self {
            Self::Id => ColumnType::Integer.def(),
            Self::Testing => ColumnType::Integer.def(),
            Self::Rust => ColumnType::Integer.def(),
            Self::Keywords => ColumnType::Integer.def(),
            Self::Type => ColumnType::Integer.def(),
            Self::Typeof => ColumnType::Integer.def(),
            Self::Crate => ColumnType::Integer.def(),
            Self::Self_ => ColumnType::Integer.def(),
        }
    }
}

impl RelationTrait for Relation {
    fn def(&self) -> RelationDef {
        panic!("No RelationDef")
    }
}

impl ActiveModelBehavior for ActiveModel {}
