Skip to content

Commit

Permalink
Re-enable :foreign-keys
Browse files Browse the repository at this point in the history
  • Loading branch information
lpoulain committed Feb 20, 2024
1 parent 0eb1f76 commit f4fe016
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
;;
(ns metabase.driver.implementation.driver-helpers
"Driver api implementation for Starburst driver."
(:require [metabase.driver :as driver]))
(:require [metabase.driver :as driver]
[metabase.config :as config]))

;;; Starburst API helpers

Expand All @@ -33,8 +34,10 @@
:native-parameters true
:expression-aggregations true
:binning true
:foreign-keys false
:foreign-keys true
:datetime-diff true
:convert-timezone true
:now true}]
(defmethod driver/database-supports? [:starburst feature] [_ _ _] supported?))

(defmethod driver/database-supports? [:starburst :foreign-keys] [_driver _feature _db] (not config/is-test?))
6 changes: 6 additions & 0 deletions drivers/starburst/src/metabase/driver/starburst.clj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
(connection/can-connect-with-spec? jdbc-spec))
(catch Throwable e (handle-execution-error e details))))

;;; The Starburst JDBC driver DOES NOT support the `.getImportedKeys` method so just return `nil` here so the
;;; implementation doesn't try to use it.
(defmethod driver/describe-table-fks :starburst
[_driver _database _table]
nil)

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

0 comments on commit f4fe016

Please sign in to comment.