From baf1ac0fdf053b54aa1a5b476f61000987478bf4 Mon Sep 17 00:00:00 2001 From: JSR Date: Fri, 20 Mar 2026 18:46:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=9C=8B=E6=9D=BFSQL?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E8=AF=AF=E5=88=A4=E6=8D=A2=E8=A1=8C=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=97=A0=E6=B3=95=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/commands/board.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/commands/board.rs b/src-tauri/src/commands/board.rs index d6ccab5..3646836 100644 --- a/src-tauri/src/commands/board.rs +++ b/src-tauri/src/commands/board.rs @@ -73,7 +73,12 @@ fn is_readonly_query(sql: &str) -> bool { } let lower = trimmed.to_ascii_lowercase(); - if !(lower.starts_with("select ") || lower.starts_with("with ")) { + let starts_with_select_or_with = lower + .split_whitespace() + .next() + .map(|first| first == "select" || first == "with") + .unwrap_or(false); + if !starts_with_select_or_with { return false; }