add: 增加对于查询得到的结果集直接进行数据编辑的功能。当查询是单表且包含主键(有联合主键时包含全部主键)时,可以在结果集内双击单元格修改数据,修改结果以事务形式提交或回滚。

This commit is contained in:
rarnu committed 2026-05-07 15:09:59 +08:00
1 parent ecbd94c7be
commit 814fda7433
15 files changed
+627 -2

No files matched your search

+17
View File
@@ -122,3 +122,20 @@ pub async fn execute_script(
Ok(Json(serde_json::to_value(result).map_err(|e| AppError(e.to_string()))?))
}
pub async fn execute_in_transaction(
State(state): State<Arc<WebState>>,
Json(req): Json<ExecuteBatchRequest>,
) -> Result<Json<serde_json::Value>, AppError> {
let result = dbx_core::query::execute_statements_in_transaction(
&state.app,
&req.connection_id,
&req.database,
&req.statements,
req.schema.as_deref(),
)
.await
.map_err(AppError)?;
Ok(Json(serde_json::to_value(result).map_err(|e| AppError(e.to_string()))?))
}