Skip to content

Commit 2270598

Browse files
authored
update metabase driver to support latest metabase.jar
feat: updates the driver from upstream and adopts a new convention for driver versions
2 parents d30af03 + 3e28ac1 commit 2270598

13 files changed

+925
-194
lines changed

README.md

+45-12
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,46 @@
1-
# Proton driver for Metabase
1+
# Timeplus Proton Driver for Metabase
22

3-
This repo is a forked from https://github.com/ClickHouse/metabase-clickhouse-driver with necessary revisions to better fit Proton.
3+
[Timeplus Proton](https://www.timeplus.com/) database driver for the [Metabase](https://metabase.com) ([GitHub](https://github.com/metabase/metabase)) business intelligence tool.
44

5-
## Install
6-
If you are about to use metabase for the first time, install the proper JVM and start it with `java -jar metabase.jar` to start it for the first time. This will create a plugins folder. Stop the Java process, put the proton.metabase-driver.jar in the plugins folder and start it again.
5+
This repo is a forked from https://github.com/ClickHouse/metabase-clickhouse-driver with necessary revisions to better fit Timeplus Proton.
76

8-
## Add database
7+
## Installation
8+
If you are about to use Metabase for the first time:
9+
10+
* install the required JDK version and start it with `java -jar metabase.jar` to start the app. This will create a `plugins/` folder in the current directory.
11+
* Stop the Java process with <kbd>Ctrl</kbd> + <kbd>C</kbd>, then copy the `proton.metabase-driver.jar` into the `plugins/` folder and restart the app.
12+
13+
Here's an example [(using Metabase v0.50.20 and Timeplus Proton driver 0.50.4)](#choosing-the-right-version):
14+
15+
```bash
16+
export METABASE_VERSION=v0.50.20
17+
export METABASE_PROTON_DRIVER_VERSION=v0.50.4
18+
19+
mkdir -p mb/plugins && cd mb
20+
curl -o metabase.jar https://downloads.metabase.com/$METABASE_VERSION/metabase.jar
21+
curl -L -o plugins/proton.metabase-driver.jar https://github.com/timeplus-io/metabase-proton-driver/releases/download/$METABASE_PROTON_DRIVER_VERSION/proton.metabase-driver.jar
22+
MB_PLUGINS_DIR=./plugins; java -jar metabase.jar
23+
```
24+
25+
## Add a Database
926

1027
1. Once you've started up Metabase, open http://localhost:3000 , go to "Admin settings" (top-right), then "Databases" tab and add a database and select "Timeplus Proton".
11-
2. You'll need to provide the Host/Port. Default localhost and 8123 just work.
28+
2. You'll need to provide the Host/Port. Default `localhost` and `8123` just work.
1229

1330
## Run Query
14-
Please note, with port 8123, by default Proton's query behavior is batch SQL, looking for the past data.
31+
Please note when set to use port `8123`, Proton's query behavior will default to batch SQL querying, looking for the past data.
1532

16-
## Build from source
17-
The build process is largely based on https://github.com/databendcloud/metabase-databend-driver. (IMHO, Leiningen provides much better compiling error message than the built-in `clojure -X:build:drivers:build/driver`)
33+
## Build from Source
34+
The build process is largely based on https://github.com/databendcloud/metabase-databend-driver.
35+
(IMHO, Leiningen provides much better compiling error message than the built-in `clojure -X:build:drivers:build/driver`)
1836

1937
### Prerequisites
2038

2139
- [Leiningen](https://leiningen.org/)
2240

2341
### Steps
2442

25-
1. Clone and build metabase dependency jar.
43+
1. Clone and build Metabase dependency jar.
2644

2745
```shell
2846
git clone https://github.com/metabase/metabase
@@ -31,7 +49,7 @@ The build process is largely based on https://github.com/databendcloud/metabase-
3149
cd modules/drivers
3250
clojure -X:deps prep
3351
cd ../..
34-
./bin/build.sh
52+
clojure -T:build uberjar
3553
```
3654

3755
2. Clone metabase-proton-driver repo
@@ -48,7 +66,7 @@ The build process is largely based on https://github.com/databendcloud/metabase-
4866
cd metabase-proton-driver
4967
mkdir repo
5068
lein pom
51-
mvn deploy:deploy-file -Durl=file:repo -DgroupId=metabase-core -DartifactId=metabase-core -Dversion=1.40 -Dpackaging=jar -Dfile=metabase.jar
69+
mvn deploy:deploy-file -Durl=file:repo -DgroupId=com.timeplus.external -DartifactId=metabase-core -Dversion=0.50.20 -Dpackaging=jar -Dfile=metabase.jar
5270
```
5371

5472
4. Build the jar (key steps to compile *.clj source code)
@@ -70,3 +88,18 @@ You should see a message on startup similar to:
7088
2023-11-18 09:55:37,102 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :proton...
7189
2023-11-18 09:55:37,102 INFO driver.impl :: Registered driver :proton (parents: [:sql-jdbc]) 🚚
7290
```
91+
92+
## Choosing the Right Version
93+
94+
Starting with Metabase v0.50.0, ClickHouse adopted a new naming convention for driver releases. The new one is intended to reflect the Metabase version the driver is supposed to run on.
95+
96+
For example, the driver version 1.**50.0** means that it should be used with Metabase v0.**50.x** or Metabase EE 1.**50.x** _only_, and it is _not guaranteed_ that this particular version of the driver can work with the previous or the following versions of Metabase.
97+
98+
We've adopted the same naming convention for the Timeplus Proton driver since our Metabase driver is a slightly modified version of the ClickHouse Metabase driver.
99+
100+
| Metabase Release | Driver Version |
101+
|------------------|----------------|
102+
| v0.47.8 | v0.0.3 |
103+
| v0.50.20 | v0.50.4 |
104+
105+

0 commit comments

Comments
 (0)