fix(schema): handle view DDL object types
This commit is contained in:
1 parent
7643148708
commit
22b8ba17bb
14 files changed
+175
-48
No files matched your search
@@ -327,7 +327,7 @@ async fn handle_list_tables_data(state: &Arc<AppState>, body: &str, stream: &mut
|
||||
respond_error(stream, "403 Forbidden", &e).await;
|
||||
return;
|
||||
}
|
||||
match dbx_core::schema::list_tables_core(state, &config.id, &database, &schema, None, None, None).await {
|
||||
match dbx_core::schema::list_tables_core(state, &config.id, &database, &schema, None, None, None, None).await {
|
||||
Ok(tables) => respond_json(stream, &tables).await,
|
||||
Err(e) => respond_error(stream, "500 Internal Server Error", &e).await,
|
||||
}
|
||||
|
||||
@@ -30,9 +30,19 @@ pub async fn list_tables(
|
||||
filter: Option<String>,
|
||||
limit: Option<usize>,
|
||||
offset: Option<usize>,
|
||||
object_types: Option<Vec<String>>,
|
||||
) -> Result<Vec<db::TableInfo>, String> {
|
||||
dbx_core::schema::list_tables_core(&state, &connection_id, &database, &schema, filter.as_deref(), limit, offset)
|
||||
.await
|
||||
dbx_core::schema::list_tables_core(
|
||||
&state,
|
||||
&connection_id,
|
||||
&database,
|
||||
&schema,
|
||||
filter.as_deref(),
|
||||
limit,
|
||||
offset,
|
||||
object_types.as_deref(),
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -118,8 +128,9 @@ pub async fn get_table_ddl(
|
||||
database: String,
|
||||
schema: String,
|
||||
table: String,
|
||||
object_type: Option<db::ObjectSourceKind>,
|
||||
) -> Result<String, String> {
|
||||
dbx_core::schema::get_table_ddl_core(&state, &connection_id, &database, &schema, &table).await
|
||||
dbx_core::schema::get_table_ddl_core(&state, &connection_id, &database, &schema, &table, object_type).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
Reference in new issue
Block a user