fix: prevent SELECT with REPLACE/TRUNCATE functions from triggering danger warning

The DANGER_RE regex matched keywords anywhere in the SQL text, causing
SELECT queries using REPLACE() or TRUNCATE() functions to incorrectly
trigger the destructive-SQL warning dialog. Check only the first keyword
of each semicolon-separated statement instead.

Also fix dialog content overflow by adding min-w-0 to the <pre> element,
and move macOS frameworks config from tauri.conf.json to CI-only
TAURI_CONFIG so local `tauri dev` no longer requires libltdl/libodbc
to be globally installed.

Closes #135
This commit is contained in:
t8y2
2026-05-07 19:07:41 +08:00
parent 484dc85114
commit aefb6bf0ef
5 changed files with 73 additions and 6 deletions
@@ -49,7 +49,7 @@ function onConfirm() {
<p class="text-sm text-muted-foreground mb-3">{{ message || t("dangerDialog.message") }}</p>
<pre
v-if="details || sql"
class="text-xs bg-muted p-3 rounded overflow-auto max-h-40 font-mono whitespace-pre-wrap"
class="text-xs bg-muted p-3 rounded overflow-auto max-h-40 min-w-0 font-mono whitespace-pre-wrap"
>{{ details || sql }}</pre
>
</div>