feat(editor): set all SQL parameters to raw

Closes #5823
This commit is contained in:
t8y2 committed 2026-08-24 18:32:50 +00:00
1 parent 6b5b33540f
commit 492c9727ae
10 files changed
+189 -1

No files matched your search

@@ -77,6 +77,15 @@ function updateKind(name: string, kind: SqlParameterValueKind) {
values.value[name] = { ...current, kind, value };
}
function setAllParametersToRaw() {
const next = { ...values.value };
for (const parameter of props.parameters) {
const current = next[parameter.key] ?? { kind: "string", value: "" };
next[parameter.key] = { ...current, kind: "raw" };
}
values.value = next;
}
function updateValue(name: string, value: string) {
const matchedHistory = histories.value[name]?.find((entry) => entry.value === value);
values.value[name] = { ...(values.value[name] ?? { kind: "string" }), ...(matchedHistory ? { kind: matchedHistory.kind } : {}), value };
@@ -135,7 +144,12 @@ async function copyResolvedSql() {
</DialogHeader>
<div class="grid max-h-[calc(86vh-8rem)] gap-4 overflow-y-auto pr-1">
<p class="text-sm text-muted-foreground">{{ t("sqlParameters.description") }}</p>
<div class="flex flex-wrap items-center gap-2">
<p class="min-w-0 flex-1 text-sm text-muted-foreground">{{ t("sqlParameters.description") }}</p>
<Button type="button" size="sm" variant="outline" class="ml-auto shrink-0" data-testid="sql-parameters-use-raw-all" @click="setAllParametersToRaw">
{{ t("sqlParameters.useRawForAll") }}
</Button>
</div>
<div class="relative z-20 max-h-[302px] overflow-auto rounded-md border bg-background">
<div class="min-w-[680px]">