"Logic for syncing the special `_metabase_metadata` table, which is a way for datasets
such as the Sample Dataset to specific properties such as special types that should
be applied during sync.
"Logic for syncing the special `_metabase_metadata` table, which is a way for datasets such as the Sample Dataset to
specific properties such as special types that should be applied during sync.
Currently, this is only used by the Sample Dataset, but theoretically in the future we could
add additional sample datasets and preconfigure them by populating this Table; or 3rd-party
applications or users can add this table to their database for an enhanced Metabase experience
out-of-the box."
Currently, this is only used by the Sample Dataset, but theoretically in the future we could add additional sample
datasets and preconfigure them by populating this Table; or 3rd-party applications or users can add this table to
their database for an enhanced Metabase experience out-of-the box."
(:require[clojure.string:asstr]
[clojure.tools.logging:aslog]
[metabase
...
...
@@ -59,20 +57,23 @@
kvalue))))))
(s/defn^:privatesync-metabase-metadata-table!
"Databases may include a table named `_metabase_metadata` (case-insentive) which includes descriptions or other metadata about the `Tables` and `Fields`
it contains. This table is *not* synced normally, i.e. a Metabase `Table` is not created for it. Instead, *this* function is called, which reads the data it
contains and updates the relevant Metabase objects.
"Databases may include a table named `_metabase_metadata` (case-insentive) which includes descriptions or other
metadata about the `Tables` and `Fields` it contains. This table is *not* synced normally, i.e. a Metabase `Table`
is not created for it. Instead, *this* function is called, which reads the data it contains and updates the relevant
value | varchar | \"The date the product was added to our catalog.\"
`keypath` is of the form `table-name.key` or `table-name.field-name.key`, where `key` is the name of some property of `Table` or `Field`.
`keypath` is of the form `table-name.key` or `table-name.field-name.key`, where `key` is the name of some property
of `Table` or `Field`.
This functionality is currently only used by the Sample Dataset. In order to use this functionality, drivers must implement optional fn `:table-rows-seq`."
This functionality is currently only used by the Sample Dataset. In order to use this functionality, drivers *must*
;; TODO - should we make this logic case-insensitive like it is for fields?
...
...
@@ -137,7 +137,8 @@
:activetrue))))
(s/defnsync-tables!
"Sync the Tables recorded in the Metabase application database with the ones obtained by calling DATABASE's driver's implementation of `describe-database`."
"Sync the Tables recorded in the Metabase application database with the ones obtained by calling DATABASE's driver's
implementation of `describe-database`."
[database:-i/DatabaseInstance]
;; determine what's changed between what info we have and what's in the DB