Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
118f7811
Unverified
Commit
118f7811
authored
5 years ago
by
Cam Saul
Browse files
Options
Downloads
Patches
Plain Diff
Support additional connection options for Snowflake
[ci snowflake]
parent
16fd858d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/drivers/snowflake/resources/metabase-plugin.yaml
+1
-0
1 addition, 0 deletions
modules/drivers/snowflake/resources/metabase-plugin.yaml
modules/drivers/snowflake/src/metabase/driver/snowflake.clj
+21
-19
21 additions, 19 deletions
modules/drivers/snowflake/src/metabase/driver/snowflake.clj
with
22 additions
and
19 deletions
modules/drivers/snowflake/resources/metabase-plugin.yaml
+
1
−
0
View file @
118f7811
...
...
@@ -33,6 +33,7 @@ driver:
-
name
:
role
display-name
:
Role
placeholder
:
my_role
-
additional-options
connection-properties-include-tunnel-config
:
true
init
:
-
step
:
load-namespace
...
...
This diff is collapsed.
Click to expand it.
modules/drivers/snowflake/src/metabase/driver/snowflake.clj
+
21
−
19
View file @
118f7811
...
...
@@ -13,6 +13,7 @@
[
common
:as
driver.common
]
[
sql-jdbc
:as
sql-jdbc
]]
[
metabase.driver.sql-jdbc
[
common
:as
sql-jdbc.common
]
[
connection
:as
sql-jdbc.conn
]
[
execute
:as
sql-jdbc.execute
]
[
sync
:as
sql-jdbc.sync
]]
...
...
@@ -39,25 +40,26 @@
account
)]
;; it appears to be the case that their JDBC driver ignores `db` -- see my bug report at
;; https://support.snowflake.net/s/question/0D50Z00008WTOMCSA5/
(
merge
{
:classname
"net.snowflake.client.jdbc.SnowflakeDriver"
:subprotocol
"snowflake"
:subname
(
str
"//"
host
".snowflakecomputing.com/"
)
:client_metadata_request_use_connection_ctx
true
:ssl
true
;; keep open connections open indefinitely instead of closing them. See #9674 and
;; https://docs.snowflake.net/manuals/sql-reference/parameters.html#client-session-keep-alive
:client_session_keep_alive
true
;; other SESSION parameters
;; use the same week start we use for all the other drivers
:week_start
7
;; not 100% sure why we need to do this but if we don't set the connection to UTC our report timezone
;; stuff doesn't work, even though we ultimately override this when we set the session timezone
:timezone
"UTC"
}
(
->
opts
;; original version of the Snowflake driver incorrectly used `dbname` in the details fields instead of
;; `db`. If we run across `dbname`, correct our behavior
(
set/rename-keys
{
:dbname
:db
})
(
dissoc
:host
:port
:timezone
)))))
(
->
(
merge
{
:classname
"net.snowflake.client.jdbc.SnowflakeDriver"
:subprotocol
"snowflake"
:subname
(
str
"//"
host
".snowflakecomputing.com/"
)
:client_metadata_request_use_connection_ctx
true
:ssl
true
;; keep open connections open indefinitely instead of closing them. See #9674 and
;; https://docs.snowflake.net/manuals/sql-reference/parameters.html#client-session-keep-alive
:client_session_keep_alive
true
;; other SESSION parameters
;; use the same week start we use for all the other drivers
:week_start
7
;; not 100% sure why we need to do this but if we don't set the connection to UTC our report timezone
;; stuff doesn't work, even though we ultimately override this when we set the session timezone
:timezone
"UTC"
}
(
->
opts
;; original version of the Snowflake driver incorrectly used `dbname` in the details fields instead of
;; `db`. If we run across `dbname`, correct our behavior
(
set/rename-keys
{
:dbname
:db
})
(
dissoc
:host
:port
:timezone
)))
(
sql-jdbc.common/handle-additional-options
opts
))))
(
defmethod
sql-jdbc.sync/database-type->base-type
:snowflake
[
_
base-type
]
({
:NUMBER
:type/Number
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment