From 2a932af8064f1f0517d034a6dc0c870d069e45cd Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Tue, 16 Sep 2025 20:26:23 -0600 Subject: [PATCH] feat: add ability to see raw SQL results on test page --- src/views/TestView.vue | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/views/TestView.vue b/src/views/TestView.vue index c0c9b04d..1e19a68f 100644 --- a/src/views/TestView.vue +++ b/src/views/TestView.vue @@ -68,10 +68,18 @@ placeholder="Enter your SQL query here..." > -
+
+

Result:

@@ -401,6 +409,7 @@ export default class Help extends Vue { // for SQL operations sqlQuery = ""; sqlResult: unknown = null; + returnRawResults = false; cryptoLib = cryptoLib; @@ -961,15 +970,28 @@ export default class Help extends Vue { * Supports both SELECT queries (dbQuery) and other SQL commands (dbExec) * Provides interface for testing raw SQL operations * Uses PlatformServiceMixin for database access and notification helpers for errors + * When returnRawResults is true, uses direct platform service methods for unparsed results */ async executeSql() { try { const isSelect = this.sqlQuery.trim().toLowerCase().startsWith("select"); - if (isSelect) { - this.sqlResult = await this.$query(this.sqlQuery); + + if (this.returnRawResults) { + // Use direct platform service methods for raw, unparsed results + if (isSelect) { + this.sqlResult = await this.$dbQuery(this.sqlQuery); + } else { + this.sqlResult = await this.$dbExec(this.sqlQuery); + } } else { - this.sqlResult = await this.$exec(this.sqlQuery); + // Use methods that normalize the result objects + if (isSelect) { + this.sqlResult = await this.$query(this.sqlQuery); + } else { + this.sqlResult = await this.$exec(this.sqlQuery); + } } + logger.log("Test SQL Result:", this.sqlResult); } catch (error) { logger.error("Test SQL Error:", error);