Skip to content

Commit

Permalink
Merge pull request #1 from GreptimeTeam/feat/skip-setting-transaction…
Browse files Browse the repository at this point in the history
…-level

feat: skipping set-isolation-level upon connection
  • Loading branch information
sunng87 authored Sep 11, 2024
2 parents bcb7b40 + a993c40 commit f93a153
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/metabase/driver/greptimedb.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
[metabase.util :as u]
[metabase.util.date-2 :as u.date]
[metabase.util.honey-sql-2 :as h2x]
[metabase.util.log :as log]))
[metabase.util.log :as log])
(:import
[java.sql Connection]))

(set! *warn-on-reflection* true)

Expand Down Expand Up @@ -201,6 +203,17 @@
[_]
"SET time_zone = %s;")

(defmethod sql-jdbc.execute/do-with-connection-with-options :greptimedb
[driver db-or-id-or-spec {:keys [^String session-timezone write?], :as options} f]
(sql-jdbc.execute/do-with-resolved-connection
driver
db-or-id-or-spec
options
(fn [^Connection conn]
(when-not (sql-jdbc.execute/recursive-connection?)
(sql-jdbc.execute/set-time-zone-if-supported! driver conn session-timezone))
(f conn))))

;;; ------------------------------------------------- date functions -------------------------------------------------

;;;; Datetime truncation functions
Expand Down

0 comments on commit f93a153

Please sign in to comment.