fix(grid): Enter 键优先选中自动补全建议项 (closes #202)

WHERE 和 ORDER BY 输入框中,有自动补全建议显示时按 Enter 键
现在会选中当前高亮的建议项,而不是直接执行查询。
This commit is contained in:
t8y2 committed 2026-05-11 11:00:02 +08:00
1 parent 22453f9097
commit 9413df686e
4 files changed
+40 -2

No files matched your search

+9
View File
@@ -258,6 +258,15 @@ pub fn list_triggers(client: &DmClient, schema: &str, table: &str) -> Result<Vec
.collect())
}
pub fn execute_query_with_schema_sync(client: &DmClient, schema: &str, sql: &str) -> Result<QueryResult, String> {
let set_schema = format!("SET SCHEMA \"{}\"", schema);
client.conn.execute(&set_schema, (), None).map_err(|e| {
log::error!("[dameng] set schema failed: {e}");
e.to_string()
})?;
execute_query_sync(client, sql)
}
pub fn execute_query_sync(client: &DmClient, sql: &str) -> Result<QueryResult, String> {
let start = Instant::now();
let sql = sql.trim().trim_end_matches(';');
+9
View File
@@ -330,6 +330,15 @@ pub async fn list_triggers(conn: &OracleClient, schema: &str, table: &str) -> Re
.collect())
}
pub async fn execute_query_with_schema(conn: &OracleClient, schema: &str, sql: &str) -> Result<QueryResult, String> {
let set_schema = format!("ALTER SESSION SET CURRENT_SCHEMA = \"{}\"", schema);
conn.execute(&set_schema, &[]).await.map_err(|e| {
log::error!("[oracle] set current_schema failed: {e}");
e.to_string()
})?;
execute_query(conn, sql).await
}
pub async fn execute_query(conn: &OracleClient, sql: &str) -> Result<QueryResult, String> {
let start = Instant::now();
let sql = sql.trim().trim_end_matches(';');