fix: add missing comment field to TableInfo initializers
The comment field was added to TableInfo but not updated in clickhouse, gaussdb, oracle, sqlite, sqlserver, dm, and schema drivers.
This commit is contained in:
1 parent
606019b86c
commit
75d7edda27
7 files changed
+13
-2
No files matched your search
@@ -96,7 +96,11 @@ pub async fn list_tables(client: &ChClient, database: &str) -> Result<Vec<TableI
|
||||
.map(|row| {
|
||||
let engine = row.get(1).and_then(|v| v.as_str()).unwrap_or("");
|
||||
let table_type = if engine.contains("View") { "VIEW" } else { "BASE TABLE" };
|
||||
TableInfo { name: row[0].as_str().unwrap_or("").to_string(), table_type: table_type.to_string() }
|
||||
TableInfo {
|
||||
name: row[0].as_str().unwrap_or("").to_string(),
|
||||
table_type: table_type.to_string(),
|
||||
comment: None,
|
||||
}
|
||||
})
|
||||
.collect())
|
||||
}
|
||||
|
||||
@@ -110,6 +110,7 @@ pub fn list_tables(client: &DmClient, schema: &str) -> Result<Vec<TableInfo>, St
|
||||
.map(|r| TableInfo {
|
||||
name: r.first().cloned().unwrap_or_default(),
|
||||
table_type: r.get(1).cloned().unwrap_or_else(|| "TABLE".to_string()),
|
||||
comment: None,
|
||||
})
|
||||
.collect())
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ pub async fn list_tables(client: &mut GaussdbClient, schema: &str) -> Result<Vec
|
||||
TableInfo {
|
||||
name: r.first().and_then(|v| v.clone()).unwrap_or_default(),
|
||||
table_type: if raw_type.contains("VIEW") { "VIEW".to_string() } else { "TABLE".to_string() },
|
||||
comment: None,
|
||||
}
|
||||
})
|
||||
.collect())
|
||||
|
||||
@@ -99,6 +99,7 @@ pub async fn list_tables(conn: &OracleClient, schema: &str) -> Result<Vec<TableI
|
||||
.map(|row| TableInfo {
|
||||
name: row.get_string(0).unwrap_or("").to_string(),
|
||||
table_type: row.get_string(1).unwrap_or("TABLE").to_string(),
|
||||
comment: None,
|
||||
})
|
||||
.collect())
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ pub async fn list_tables(pool: &SqlitePool, _schema: &str) -> Result<Vec<TableIn
|
||||
TableInfo {
|
||||
name: row.get::<String, _>("name"),
|
||||
table_type: if t == "view" { "VIEW".to_string() } else { "BASE TABLE".to_string() },
|
||||
comment: None,
|
||||
}
|
||||
})
|
||||
.collect())
|
||||
|
||||
@@ -106,6 +106,7 @@ pub async fn list_tables(client: &mut SqlServerClient, schema: &str) -> Result<V
|
||||
.map(|row| TableInfo {
|
||||
name: row.get::<&str, _>(0).unwrap_or("").to_string(),
|
||||
table_type: row.get::<&str, _>(1).unwrap_or("BASE TABLE").to_string(),
|
||||
comment: None,
|
||||
})
|
||||
.collect())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user