Utility functions for common operations on drivers.
Utility functions for common operations on drivers.
(available-drivers)
Return a set of all currently available drivers.
Return a set of all currently available drivers.
(available-drivers-info)
Return info about all currently available drivers, including their connection properties fields and supported features.
Return info about all currently available drivers, including their connection properties fields and supported features.
(can-connect-with-details? driver details-map & [throw-exceptions])
Check whether we can connect to a database with driver
and details-map
and perform a basic query such as SELECT 1
. Specify optional param throw-exceptions
if you want to handle any exceptions thrown yourself (e.g., so you
can pass the exception message along to the user); otherwise defaults to returning false
if a connection cannot be
established.
(can-connect-with-details? :postgres {:host "localhost", :port 5432, ...})
Check whether we can connect to a database with `driver` and `details-map` and perform a basic query such as `SELECT 1`. Specify optional param `throw-exceptions` if you want to handle any exceptions thrown yourself (e.g., so you can pass the exception message along to the user); otherwise defaults to returning `false` if a connection cannot be established. (can-connect-with-details? :postgres {:host "localhost", :port 5432, ...})
(database->driver database-or-id)
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).
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).
(features driver)
Return a set of all features supported by driver
.
Return a set of all features supported by `driver`.
(find-and-load-all-drivers!)
Search classpath for namespaces that start with metabase.driver.
, then require
them, which should register them
as a side-effect. Note that this will not load drivers added by 3rd-party plugins; they must register themselves
appropriately when initialized by load-plugins!
.
This really only needs to be done by the public settings API endpoint to populate the list of available drivers. Please avoid using this function elsewhere, as loading all of these namespaces can be quite expensive!
Search classpath for namespaces that start with `metabase.driver.`, then `require` them, which should register them as a side-effect. Note that this will not load drivers added by 3rd-party plugins; they must register themselves appropriately when initialized by `load-plugins!`. This really only needs to be done by the public settings API endpoint to populate the list of available drivers. Please avoid using this function elsewhere, as loading all of these namespaces can be quite expensive!
(report-timezone-if-supported driver)
Returns the report-timezone if driver
supports setting it's timezone and a report-timezone has been specified by
the user.
Returns the report-timezone if `driver` supports setting it's timezone and a report-timezone has been specified by the user.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close