1use crate::PgType;
2use std::collections::BTreeMap;
3
4#[derive(Debug, Default, Clone)]
5pub struct PgTableDesc {
6 pub data: BTreeMap<String, Vec<PgTableItem>>,
7}
8
9impl PgTableDesc {
10 pub fn get_data(&self, key: String, case_sensitive: bool) -> Option<&Vec<PgTableItem>> {
11 let key = if case_sensitive {
12 key
13 } else {
14 key.to_uppercase()
15 };
16 self.data.get(&key)
17 }
18}
19
20#[derive(Debug, Clone)]
21pub struct PgTableItem {
22 pub name: String,
24 pub table_id: usize,
26 pub col_index: usize,
28 pub r#type: PgType,
30 pub length: usize,
32 pub scale: usize,
34 pub nullable: bool,
35 pub default_val: Option<String>,
36 pub table_name: String,
37 pub create_time: String,
38}