Skip to content

Commit

Permalink
v0.45.x compatibility (#107)
Browse files Browse the repository at this point in the history
* v0.44.x compatibility

* v0.45.x compatibility

* Bump metabase version

* Resolve merge conflicts

* Fix tests

* Update README, bump plugin version

* Update the list of tests
  • Loading branch information
slvrtrn authored Dec 14, 2022
1 parent af6f48e commit 4d1d809
Show file tree
Hide file tree
Showing 7 changed files with 2,849 additions and 420 deletions.
3,234 changes: 2,827 additions & 407 deletions .github/deps.edn

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v2
with:
repository: metabase/metabase
ref: v0.44.6
ref: v0.45.1

- name: Checkout Driver Repo
uses: actions/checkout@v2
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
6. Make sure you are the in the directory where your `metabase.jar` lives.
7. Run `MB_PLUGINS_DIR=./plugins; java -jar metabase.jar`.

For example [(using Metabase v0.44.6 and ClickHouse driver 0.8.3)](#choosing-the-right-version):
For example [(using Metabase v0.45.1 and ClickHouse driver 0.9.1)](#choosing-the-right-version):

```bash
mkdir -p mb/plugins && cd mb
curl -o metabase.jar https://downloads.metabase.com/v0.44.6/metabase.jar
curl -L -o plugins/ch.jar https://github.com/enqueue/metabase-clickhouse-driver/releases/download/0.8.3/clickhouse.metabase-driver.jar
curl -o metabase.jar https://downloads.metabase.com/v0.45.1/metabase.jar
curl -L -o plugins/ch.jar https://github.com/enqueue/metabase-clickhouse-driver/releases/download/0.9.1/clickhouse.metabase-driver.jar
MB_PLUGINS_DIR=./plugins; java -jar metabase.jar
```

Expand All @@ -47,10 +47,10 @@ Alternatively, if you don't want to run Metabase Jar, you can use a Docker image

```bash
mkdir -p mb/plugins && cd mb
curl -L -o plugins/ch.jar https://github.com/enqueue/metabase-clickhouse-driver/releases/download/0.8.3/clickhouse.metabase-driver.jar
curl -L -o plugins/ch.jar https://github.com/enqueue/metabase-clickhouse-driver/releases/download/0.9.1/clickhouse.metabase-driver.jar
docker run -d -p 3000:3000 \
--mount type=bind,source=$PWD/plugins/ch.jar,destination=/plugins/clickhouse.jar \
--name metabase metabase/metabase:v0.44.6
--name metabase metabase/metabase:v0.45.1
```

## Choosing the Right Version
Expand All @@ -66,6 +66,7 @@ Metabase Release | Driver Version
0.41.3.1 | 0.8.1
0.42.x | 0.8.1
0.44.x | 0.9.0
0.45.x | 0.9.1

## Creating a Metabase Docker image with ClickHouse driver

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
- './.docker/users.xml:/etc/clickhouse-server/users.xml'

metabase:
image: metabase/metabase:v0.44.6
image: metabase/metabase:v0.45.1
container_name: metabase-with-clickhouse-driver
ports:
- '3000:3000'
Expand Down
2 changes: 1 addition & 1 deletion resources/metabase-plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
info:
name: Metabase ClickHouse Driver
version: 0.9.0
version: 0.9.1
description: Allows Metabase to connect to ClickHouse databases.
driver:
name: clickhouse
Expand Down
1 change: 0 additions & 1 deletion src/metabase/driver/clickhouse.clj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
OffsetDateTime
OffsetTime
ZonedDateTime]
java.lang.Byte
java.util.Arrays))

(driver/register! :clickhouse :parent :sql-jdbc)
Expand Down
17 changes: 13 additions & 4 deletions test/metabase/driver/clickhouse_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
[metabase.test.util :as tu]))

(deftest clickhouse-server-timezone
(mt/test-driver :clickhouse (is (= "UTC" (tu/db-timezone-id)))))
(mt/test-driver
:clickhouse
(is (= "UTC"
(let [spec (sql-jdbc.conn/connection-details->spec :clickhouse {})]
(metabase.driver/db-default-timezone :clickhouse spec))))))

(deftest now-converted-to-timezone
(mt/test-driver
Expand Down Expand Up @@ -401,15 +405,20 @@
:fields #{{:name "enum1"
:database-type "Enum8"
:base-type :type/Text
:database-position 0}
:database-position 0
; TODO: in Metabase 0.45.0-RC this returned true,
; and now it is false, which is strange, cause it is not Nullable in the DDL
:database-required false}
{:name "enum2"
:database-type "Enum16"
:base-type :type/Text
:database-position 1}
:database-position 1
:database-required false}
{:name "enum3"
:database-type "Enum8"
:base-type :type/Text
:database-position 2}}}
:database-position 2
:database-required false}}}
(ctu/do-with-metabase-test-db
(fn [db]
(driver/describe-table :clickhouse db {:name "enums_test"})))))))
Expand Down

0 comments on commit 4d1d809

Please sign in to comment.