Closed korbash closed 2 months ago
Current focus of the tool is syncing metadata (like tables and exposures) between dbt and Metabase. Generating questions goes well beyond that into analytics.
Okay, I see. This feature is really needed for me, so I will implement it anyway. If you decide to add it to this project one day, please let me know)
Tag me on the pull request in your fork when you do, I'd be curious how you implement it.
Auto-Create Metabase Questions from dbt Models
Creating SQL queries with multiple filters can be challenging. One of the most useful types of filters in Metabase is the Field Filters. Interestingly, it's possible to integrate these filters directly from dbt models!
We can enhance the
schema.yml
file by adding filter features to columns intended to be used as filters. Here's an example of how to define these attributes in the metadata section:To utilize these filters in the dbt models that are to be transformed into Metabase queries, reference the column in your model as follows:
After this setup, the dbt-metabase tool can automatically generate Metabase questions using the information from the
manifest.json
and the compiled models code.