Skip to content

Commit 54da59f

Browse files
committed
Release v1.3.0
2 parents d287fd8 + 95227c7 commit 54da59f

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

project.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
(defproject evosec/firebird-driver "1.2.1"
1+
(defproject evosec/firebird-driver "1.3.0
22
:min-lein-version "2.5.0"
33
44
:dependencies
5-
[[org.firebirdsql.jdbc/jaybird-jdk18 "3.0.8"]]
5+
[[org.firebirdsql.jdbc/jaybird "4.0.2.java8"]]
66
77
:profiles
88
{:provided

src/metabase/driver/firebird.clj

+6-18
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
firebird->spec
4242
(sql-jdbc.common/handle-additional-options details)))
4343

44-
;; Use "SELECT 1 FROM RDB$DATABASE" instead of "SELECT 1"
4544
(defmethod driver/can-connect? :firebird [driver details]
4645
(let [connection (sql-jdbc.conn/connection-details->spec driver (ssh/include-ssh-tunnel details))]
4746
(= 1 (first (vals (first (jdbc/query connection ["SELECT 1 FROM RDB$DATABASE"])))))))
@@ -81,22 +80,11 @@
8180
items
8281
(* items (dec page)))]))
8382

84-
;; Firebird stores table names as CHAR(31), so names with < 31 characters get padded with spaces.
85-
;; This confuses everyone, including metabase, so we trim the table names here
86-
(defn post-filtered-trimmed-active-tables
87-
"Alternative implementation of `ISQLDriver/active-tables` best suited for DBs with little or no support for schemas.
88-
Fetch *all* Tables, then filter out ones whose schema is in `excluded-schemas` Clojure-side."
89-
[driver, ^DatabaseMetaData metadata, & [db-name-or-nil]]
90-
(set (for [table (sql-jdbc.sync/post-filtered-active-tables driver metadata db-name-or-nil)]
91-
{:name (str/trim (:name table))
92-
:description (:description table)
93-
:schema (:schema table)})))
94-
9583
(defmethod sql-jdbc.sync/active-tables :firebird [& args]
96-
(apply post-filtered-trimmed-active-tables args))
84+
(apply sql-jdbc.sync/post-filtered-active-tables args))
9785

9886
;; Convert unix time to a timestamp
99-
(defmethod sql.qp/unix-timestamp->timestamp [:firebird :seconds] [_ _ expr]
87+
(defmethod sql.qp/unix-timestamp->honeysql [:firebird :seconds] [_ _ expr]
10088
(hsql/call :DATEADD (hsql/raw "SECOND") expr (hx/cast :TIMESTAMP (hx/literal "01-01-1970 00:00:00"))))
10189

10290
;; Helpers for Date extraction
@@ -165,12 +153,12 @@
165153
(defmethod sql.qp/date [:firebird :quarter-of-year] [_ _ expr] (hx/+ (hx// (hx/- (hsql/call :extract :MONTH expr) 1) 3) 1))
166154
(defmethod sql.qp/date [:firebird :year] [_ _ expr] (hsql/call :extract :YEAR expr))
167155

168-
(defmethod driver/date-add :firebird [driver dt amount unit]
156+
(defmethod sql.qp/add-interval-honeysql-form :firebird [driver hsql-form amount unit]
169157
(if (= unit :quarter)
170-
(recur driver dt (hx/* amount 3) :month)
171-
(hsql/call :dateadd (hsql/raw (name unit)) amount dt)))
158+
(recur driver hsql-form (hx/* amount 3) :month)
159+
(hsql/call :dateadd (hsql/raw (name unit)) amount hsql-form)))
172160

173-
(defmethod sql.qp/current-datetime-fn :firebird [_]
161+
(defmethod sql.qp/current-datetime-honeysql-form :firebird [_]
174162
(hx/cast :timestamp (hx/literal :now)))
175163

176164
(defmethod driver.common/current-db-time-date-formatters :firebird [_]

0 commit comments

Comments
 (0)