pub trait TableUtil {
// Required methods
fn get_name(&self) -> String;
fn get_all_tables(&self) -> String;
fn get_table(&self, table: &str) -> String;
fn transform(&self, table: &SqlStatement) -> Result<Box<dyn Table>>;
fn generate_models(
&self,
tables: Vec<SqlStatement>,
models_path: &Path,
) -> Result<()>;
fn get_field_type(&self, detect_field: &DetectField) -> (&str, &str);
// Provided method
fn detect_fields(&self, field_str: &str) -> DetectField { ... }
}
Required Methods§
fn get_name(&self) -> String
fn get_all_tables(&self) -> String
fn get_table(&self, table: &str) -> String
fn transform(&self, table: &SqlStatement) -> Result<Box<dyn Table>>
fn generate_models( &self, tables: Vec<SqlStatement>, models_path: &Path, ) -> Result<()>
Sourcefn get_field_type(&self, detect_field: &DetectField) -> (&str, &str)
fn get_field_type(&self, detect_field: &DetectField) -> (&str, &str)
从DetectField中获取字段类型和结构体类型
Provided Methods§
Sourcefn detect_fields(&self, field_str: &str) -> DetectField
fn detect_fields(&self, field_str: &str) -> DetectField
从字段字符串中检测字段类型和长度