added some extra known write query keywords to the slq api and hide the Affected rows in case empty to avoid ambiguities

This commit is contained in:
Gani Georgiev
2026-06-06 19:25:41 +03:00
parent 21dd105d9a
commit 4624e84b50
8 changed files with 19 additions and 8 deletions
+9 -1
View File
@@ -75,6 +75,8 @@ export function pageSQLConsole(route) {
query = query?.replace(/[\s\;]/gm, " ").toUpperCase() + " ";
return !![
"ALTER ",
"REPLACE ",
"INSERT ",
"CREATE ",
"UPDATE ",
@@ -349,7 +351,13 @@ export function pageSQLConsole(route) {
className: "alert success m-b-sm",
},
t.p({ className: "txt-bold" }, "Query executed successfully!"),
t.p(null, "Affected rows: ", () => pageData.result?.affectedRows || 0),
() => {
// show the affected rows only when a non empty value is returned
// to avoid ambiguity with drivers that don't support it
if (pageData.result?.affectedRows) {
return t.p(null, "Affected rows: ", pageData.result?.affectedRows);
}
},
),
// rows
t.div(