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
0faee9e8
Commit
0faee9e8
authored
7 years ago
by
Kenneth Bier
Browse files
Options
Downloads
Patches
Plain Diff
only fetch database schemas that the user requests
parent
825c21ba
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/driver/snowflake.clj
+9
-13
9 additions, 13 deletions
src/metabase/driver/snowflake.clj
with
9 additions
and
13 deletions
src/metabase/driver/snowflake.clj
+
9
−
13
View file @
0faee9e8
...
...
@@ -20,10 +20,12 @@
(
let
[
host
(
if
regionid
(
str
account
"."
regionid
)
account
)]
(
merge
{
:subprotocol
"snowflake"
:classname
"net.snowflake.client.jdbc.SnowflakeDriver"
:subname
(
str
"//"
host
".snowflakecomputing.com/"
)
:ssl
true
}
(
merge
{
:subprotocol
"snowflake"
:classname
"net.snowflake.client.jdbc.SnowflakeDriver"
:subname
(
str
"//"
host
".snowflakecomputing.com/"
)
;; Don't fetch schemas for databases if the user supplies a single database.
:client_metadata_request_use_connection_ctx
true
:ssl
true
}
(
dissoc
opts
:host
:port
))))
(
defrecord
SnowflakeDriver
[]
...
...
@@ -114,7 +116,6 @@
driver/IDriver
(
merge
(
sql/IDriverSQLDefaultsMixin
)
{
:date-interval
(
u/drop-first-arg
date-interval
)
;; :describe-table-fks (u/drop-first-arg describe-table-fks)
:details-fields
(
constantly
(
ssh/with-tunnel-config
[{
:name
"account"
:display-name
"Account"
...
...
@@ -158,13 +159,13 @@
:set-timezone-sql
(
constantly
"alter session set time_zone = %s"
)
:unix-timestamp->timestamp
(
u/drop-first-arg
unix-timestamp->timestamp
)
:column->base-type
(
u/drop-first-arg
column->base-type
)}
;; HACK ! When we test against
Redshift
we use a session-unique schema so we can run simultaneous tests
;; HACK ! When we test against
Snowflake
we use a session-unique schema so we can run simultaneous tests
;; against a single remote host; when running tests tell the sync process to ignore all the other schemas
#
_
(
when
config/is-test?
{
:excluded-schemas
(
memoize
(
fn
[
_
]
(
require
'metabase.test.data.
redshift
)
(
let
[
session-schema-number
@
(
resolve
'metabase.test.data.
redshift
/session-schema-number
)]
(
require
'metabase.test.data.
snowflake
)
(
let
[
session-schema-number
@
(
resolve
'metabase.test.data.
snowflake
/session-schema-number
)]
(
set
(
conj
(
for
[
i
(
range
240
)
:when
(
not=
i
session-schema-number
)]
(
str
"schema_"
i
))
...
...
@@ -176,8 +177,3 @@
"Register the Snowflake driver"
[]
(
driver/register-driver!
:Snowflake
(
SnowflakeDriver.
)))
(
comment
)
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