Timeplus Proton database driver for the Metabase (GitHub) business intelligence tool.
This repo is a forked from https://github.com/ClickHouse/metabase-clickhouse-driver with necessary revisions to better fit Timeplus Proton.
If you are about to use Metabase for the first time:
- install the required JDK version and start it with
java -jar metabase.jar
to start the app. This will create aplugins/
folder in the current directory. - Stop the Java process with Ctrl + C, then copy the
proton.metabase-driver.jar
into theplugins/
folder and restart the app.
Here's an example (using Metabase v0.50.21 and Timeplus Proton driver 0.50.5):
export METABASE_VERSION=v0.50.21
export METABASE_PROTON_DRIVER_VERSION=v0.50.5
mkdir -p mb/plugins && cd mb
curl -o metabase.jar https://downloads.metabase.com/$METABASE_VERSION/metabase.jar
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
MB_PLUGINS_DIR=./plugins; java -jar metabase.jar
- 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".
- You'll need to provide the Host/Port. Default
localhost
and8123
just work.
Please note when set to use port 8123
, Proton's query behavior will default to batch SQL querying, looking for the past data.
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
)
-
Clone and build Metabase dependency jar.
git clone https://github.com/metabase/metabase cd metabase clojure -X:deps prep cd modules/drivers clojure -X:deps prep cd ../.. clojure -T:build uberjar
-
Clone metabase-proton-driver repo
cd modules/drivers git clone https://github.com/timeplus-io/metabase-proton-driver
-
Prepare metabase dependencies
cp ../../target/uberjar/metabase.jar metabase-proton-driver/ cd metabase-proton-driver mkdir repo lein pom mvn deploy:deploy-file -Durl=file:repo -DgroupId=com.timeplus.external -DartifactId=metabase-core -Dversion=0.50.21 -Dpackaging=jar -Dfile=metabase.jar
-
Build the jar (key steps to compile *.clj source code)
LEIN_SNAPSHOTS_IN_RELEASE=true DEBUG=1 lein uberjar
-
Let's assume we download
metabase.jar
from the Metabase jar to~/metabase/
and we built the project above. Copy the built jar(target/uberjar/proton.metabase-driver.jar) to the Metabase plugins folder and run Metabase from there!cd ~/metabase/ java -jar metabase.jar
You should see a message on startup similar to:
2023-11-18 09:55:37,102 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :proton...
2023-11-18 09:55:37,102 INFO driver.impl :: Registered driver :proton (parents: [:sql-jdbc]) 🚚
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.
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.
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.
Metabase Release | Driver Version |
---|---|
v0.47.8 | v0.0.3 |
v0.50.21 | v0.50.5 |