Skip to content

Build your personal knowledge base with Trilium Notes

feat(sql_console): improve display for statements

Elian Doran748b87da9af8
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 19beceee38..f112508c1e 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -1818,6 +1818,7 @@
"not_executed": "The query has not been executed yet.",
"no_rows": "No rows have been returned for this query",
"failed": "SQL query execution has failed",
+ "statement_result": "Statement result",
"execute_now": "Execute now"
},
"sql_table_schemas": {
diff --git a/apps/client/src/widgets/type_widgets/SqlConsole.tsx b/apps/client/src/widgets/type_widgets/SqlConsole.tsx
index 2af9c8f0fc..d7cd02f0ed 100644
--- a/apps/client/src/widgets/type_widgets/SqlConsole.tsx
+++ b/apps/client/src/widgets/type_widgets/SqlConsole.tsx
@@ -82,7 +82,15 @@ function SqlResults({ ntxId }: TypeWidgetProps) {
{response?.results.map((rows, index) => {
// inserts, updates
if (typeof rows === "object" && !Array.isArray(rows)) {
- return <pre key={index}>{JSON.stringify(rows, null, "\t")}</pre>;
+ return (
+ <NoItems
+ key={index}
+ icon="bx bx-play"
+ text={t("sql_result.statement_result")}
+ >
+ <pre key={index}>{JSON.stringify(rows, null, "\t")}</pre>
+ </NoItems>
+ );
}
// selects