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
c6590e0b
Commit
c6590e0b
authored
5 years ago
by
Tom Robinson
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:metabase/metabase into merge-master-to-release-0.33.x
parents
badd05bb
978e5091
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/drivers/redshift/test/metabase/driver/redshift_test.clj
+1
-0
1 addition, 0 deletions
...s/drivers/redshift/test/metabase/driver/redshift_test.clj
project.clj
+1
-0
1 addition, 0 deletions
project.clj
src/metabase/driver/util.clj
+11
-6
11 additions, 6 deletions
src/metabase/driver/util.clj
with
13 additions
and
6 deletions
modules/drivers/redshift/test/metabase/driver/redshift_test.clj
+
1
−
0
View file @
c6590e0b
(
ns
metabase.driver.redshift-test
(
:require
[
clojure.test
:refer
:all
]
[
metabase.plugins.jdbc-proxy
:as
jdbc-proxy
]
[
metabase.test
[
fixtures
:as
fixtures
]
[
util
:as
tu
]]
...
...
This diff is collapsed.
Click to expand it.
project.clj
+
1
−
0
View file @
c6590e0b
...
...
@@ -122,6 +122,7 @@
[
org.tcrawley/dynapath
"1.0.0"
]
; Dynamically add Jars (e.g. Oracle or Vertica) to classpath
[
org.yaml/snakeyaml
"1.23"
]
; YAML parser (required by liquibase)
[
potemkin
"0.4.5"
]
; utility macros & fns
[
pretty
"1.0.1"
]
; protocol for defining how custom types should be pretty printed
[
prismatic/schema
"1.1.11"
]
; Data schema declaration and validation library
[
puppetlabs/i18n
"0.8.0"
]
; Internationalization library
[
redux
"0.1.4"
]
; Utility functions for building and composing transducers
...
...
This diff is collapsed.
Click to expand it.
src/metabase/driver/util.clj
+
11
−
6
View file @
c6590e0b
(
ns
metabase.driver.util
"Utility functions for common operations on drivers."
(
:require
[
clojure.string
:as
str
]
(
:require
[
clojure.core.memoize
:as
memoize
]
[
clojure.string
:as
str
]
[
clojure.tools.logging
:as
log
]
[
metabase
[
config
:as
config
]
...
...
@@ -55,12 +56,16 @@
;;; +----------------------------------------------------------------------------------------------------------------+
(
defn-
database->driver*
[
database-or-id
]
(
db/select-one-field
:engine
'Database,
:id
(
u/get-id
database-or-id
)))
(
or
(
:engine
database-or-id
)
(
db/select-one-field
:engine
'Database,
:id
(
u/get-id
database-or-id
))))
(
def
^
{
:arglists
'
([
database-or-id
])}
database->driver
"Memoized function that returns the driver instance that should be used for `Database` with ID. (Databases aren't
expected to change their types, and this optimization makes things a lot faster)."
(
memoize
database->driver*
))
"Look up the driver that should be used for a Database. Lightly cached.
(This is cached for a second, so as to avoid repeated application DB calls if this function is called several times
over the duration of a single API request or sync operation.)"
(
memoize/ttl
database->driver*
:ttl/threshold
1000
))
;;; +----------------------------------------------------------------------------------------------------------------+
...
...
@@ -111,7 +116,7 @@
features."
[]
(
into
{}
(
for
[
driver
(
available-drivers
)]
;; TODO - maybe we should rename `
connection-propertie
s` -> `connection-properties` on the FE as well?
;; TODO - maybe we should rename `
details-field
s` -> `connection-properties` on the FE as well?
[
driver
{
:details-fields
(
driver/connection-properties
driver
)
:driver-name
(
driver/display-name
driver
)
#
_
:features
#
_
(
features
driver
)}])))
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