Skip to content

Commit

Permalink
Add query remarks
Browse files Browse the repository at this point in the history
Add query remarks
  • Loading branch information
lpoulain committed Oct 26, 2023
1 parent 76d8596 commit 7e384ae
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion drivers/starburst/src/metabase/driver/starburst.clj
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,27 @@
(ns metabase.driver.starburst
"Starburst driver."
(:require [metabase.driver :as driver]
[metabase.driver.sql-jdbc.execute.legacy-impl :as sql-jdbc.legacy]))
[metabase.query-processor.util :as qp.util]
[metabase.public-settings :as public-settings]
[metabase.driver.sql-jdbc.execute.legacy-impl :as sql-jdbc.legacy]))
(driver/register! :starburst, :parent #{::sql-jdbc.legacy/use-legacy-classes-for-read-and-set})

(prefer-method driver/database-supports? [:starburst :set-timezone] [:sql-jdbc :set-timezone])

(defn format-field
[name value]
(if (nil? value)
""
(str " " name ": " value)))

(defmethod qp.util/query->remark :starburst
[_ {{:keys [card-id dashboard-id]} :info, :as query}]
(str
(qp.util/default-query->remark query)
(format-field "accountID" (public-settings/site-uuid))
(format-field "dashboardID" dashboard-id)
(format-field "cardID" card-id)))

;;; +----------------------------------------------------------------------------------------------------------------+
;;; | Load implemetation files |
;;; +----------------------------------------------------------------------------------------------------------------+
Expand Down

0 comments on commit 7e384ae

Please sign in to comment.