Skip to content

Commit

Permalink
Add application name with driver and metabase versions (#54)
Browse files Browse the repository at this point in the history
* Add application name with driver and metabase versions

* Update driver version to v1.2.1
  • Loading branch information
bobbyiliev authored Oct 30, 2024
1 parent e90a658 commit aa4bf50
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ sudo -- sh -c "echo 127.0.0.1 materialize >> /etc/hosts"
docker compose -f modules/drivers/materialize/docker-compose.yml up -d materialize
```

* To use a specific Java version, you can set the `JAVA_HOME` environment variable:

```bash
export JAVA_HOME=$(/usr/libexec/java_home -v 17) ; export PATH=$JAVA_HOME/bin:$PATH
```

Now, you should be able to run the tests:

```bash
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ v0.46.7 | v0.1.0
v0.47.0 | v1.0.0
v0.47.1 | v1.0.1 <br> v1.0.2 <br> v1.0.3
v0.49.12 | v1.1.0
v0.50.10 | v1.2.0
v0.50.10 | v1.2.0 <br> v1.2.1

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion resources/metabase-plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Reference: https://github.com/metabase/metabase/wiki/Metabase-Plugin-Manifest-Reference
info:
name: Metabase Materialize Driver
version: 1.2.0
version: 1.2.1
description: Allows Metabase to connect to Materialize.
contact-info:
name: Materialize Inc.
Expand Down
10 changes: 8 additions & 2 deletions src/metabase/driver/materialize.clj
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@

(defmethod sql-jdbc.conn/connection-details->spec :materialize
[_ details]
(let [merged-details (merge default-materialize-connection-details details)]
(let [merged-details (merge default-materialize-connection-details details)
;; TODO: get the driver version from the plugin manifest instead of hardcoding it
driver-version "v1.2.1"
app-name (format "Metabase Materialize driver %s %s"
driver-version
config/mb-app-id-string)]
(validate-connection-details merged-details)
(let [{:keys [host port db cluster ssl], :as opts} merged-details]
(sql-jdbc.common/handle-additional-options
Expand All @@ -83,7 +88,8 @@
:subprotocol "postgresql"
:subname (str "//" host ":" port "/" db "?options=--cluster%3D" cluster)
:sslmode (if ssl "require" "disable")
:OpenSourceSubProtocolOverride false}
:OpenSourceSubProtocolOverride false
:ApplicationName app-name}
(dissoc opts :host :port :db :cluster :ssl))))))

(defmethod driver/describe-table :materialize
Expand Down

0 comments on commit aa4bf50

Please sign in to comment.