Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
added old_implicit_casting settings to the database settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexR2D2 committed Apr 1, 2024
1 parent 48ce6cf commit d581928
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion resources/metabase-plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
info:
name: Metabase DuckDB Driver
version: 1.0.0-SNAPSHOT-0.1.12
version: 1.0.0-SNAPSHOT-0.1.13
description: Allows Metabase to connect to DuckDB databases.
contact-info:
name: Alexander Golubov
Expand All @@ -19,6 +19,11 @@ driver:
display-name: Establish a read-only connection
default: false
type: boolean
- name: old_implicit_casting
display-name: Use old_implicit_casting
default: false
type: boolean

init:
- step: load-namespace
namespace: metabase.driver.duckdb
Expand Down
4 changes: 2 additions & 2 deletions src/metabase/driver/duckdb.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
(driver/register! :duckdb, :parent :sql-jdbc)

(defmethod sql-jdbc.conn/connection-details->spec :duckdb
[_ {:keys [database_file, read_only], :as details}]
[_ {:keys [database_file, read_only, old_implicit_casting], :as details}]
(let [conn_details (merge
{:classname "org.duckdb.DuckDBDriver"
:subprotocol "duckdb"
:subname (or database_file "")
"duckdb.read_only" (str read_only)
"old_implicit_casting" "true"}
"old_implicit_casting" (str old_implicit_casting)}
(dissoc details :database_file :read_only :port :engine))]
conn_details))

Expand Down

0 comments on commit d581928

Please sign in to comment.