use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DieselTable {
pub name: String,
pub primary_key: Vec<String>,
pub columns: Vec<DieselColumn>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DieselColumn {
pub name: String,
pub sql_type: DieselSqlType,
pub is_nullable: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub enum DieselSqlType {
Int4,
Int8,
Int2,
Float4,
Float8,
Numeric,
Text,
Varchar,
Bool,
Timestamp,
Date,
Time,
Json,
Jsonb,
Bytea,
Uuid,
Nullable(Box<DieselSqlType>),
Custom(String),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DieselJoinable {
pub child_table: String,
pub parent_table: String,
pub foreign_key: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DieselSchema {
pub tables: Vec<DieselTable>,
pub joinables: Vec<DieselJoinable>,
}