sea_orm_dbml/compiler/
config.rs1use std::ffi::OsString;
2
3#[derive(Debug)]
4pub enum EnumType {
5 String(Option<u32>),
6 Integer,
7}
8
9#[derive(Debug)]
10pub struct Config {
12 pub in_path: OsString,
14 pub out_path: OsString,
16 pub target: Target,
18 pub enum_type: EnumType,
21 pub is_native_enum: bool
23}
24
25impl Default for Config {
26 fn default() -> Self {
27 Self {
28 in_path: OsString::from(""),
29 out_path: OsString::from(""),
30 target: Target::Postgres,
31 enum_type: EnumType::String(None),
32 is_native_enum: true
33 }
34 }
35}
36
37impl Config {
38 pub fn validate(&self) -> Option<&str> {
39 if self.in_path.is_empty() {
40 Some("in_path is not set")
41 } else if self.out_path.is_empty() {
42 Some("out_path is not set")
43 } else {
44 None
45 }
46 }
47}
48
49#[derive(Debug, PartialEq, Clone)]
51pub enum Target {
52 Postgres,
54 }
56