-
Notifications
You must be signed in to change notification settings - Fork 4.9k
What's new in 0.41.0 for Metabase driver authors
New Methods
-
metabase.driver/database-supports?
has been added. Previously, the idea that a driver supports some feature was static. In order to support the notion of feature support being predicated on some attribute of the runtime database itself, we have addeddatabase-supports?
. To give a concrete example: an older version of some database might not support regular expressions, but a newer one might (in which case, thedatabase-supports?
implementation can check whether the current server version is high enough). This method has almost the same signature as the previoussupports?
method except that thedatabase
is passed as an additional argument. See this issue for full context. The default implementation (provided by us), simply ignores thedatabase
and defers to callingsupports?
. Eventually, all invocations ofsupports?
made within our code will be removed in favor of invocations todatabase-supports?
, at which point we will remove the multimethod. -
metabase.driver.sql.query-processor/escape-alias
has been added. The idea behind this method is to provide drivers a way to "escape" any type of alias String (i.e. the name appearing right after theAS
keyword in the generated query). Some databases don't allow certain characters in the alias, even when quoted, so this is to provide a mechanism to escape/translate such characters to make the alias name legal (see this issue for more context). The default implementation (provided by us, for:sql
drivers) simply returns the String unchanged. -
metabase.driver/normalize-db-details
has been added as a way to perform more complex migrations of thedb-details
(i.e. the blob stored in the database containing all the connection information). It is invoked immediately after fetching the details from the application DB, before opening new connections using those details, or rendering the edit page (if opening a DB). The default implementation simply returnsdb-details
unchanged. -
metabase.driver/superseded-by
has been added as a way to indicate some driver is deprecated by/superseded by a different one. It can be set by adding ansuperseded-by
entry to the YAML file as shown here. To see how this flag affects the UI/UX of the database edit application, try creating a newPresto
database in0.41
.
Deprecated Methods
-
metabase.driver/supports?
is newly deprecated, and will be removed in a future release. See discussion ofdatabase-supports?
above. -
metabase.driver.sql.query-processor/field->alias
is newly deprecated, and will be removed in a future release, at which point the newescape-alias
method (see above) will be called with the field's:name
as the argument.
- Backend
- Metabase Developer Reference
- Product Management
- QA and Testing
- Writing A Driver
- Driver Notices
- REST API Notices
- Writing style guide for documentation and blog posts (WIP)