gouline / dbt-metabase

dbt + Metabase integration
https://pypi.org/project/dbt-metabase/
MIT License
441 stars 63 forks source link

Pass Metabase database ID when exporting models #253

Open eskrm opened 2 months ago

eskrm commented 2 months ago

Currently it seems the only way to pass a Metabase database is by display name. Example from README:

dbt-metabase models \
    --manifest-path target/manifest.json \
    --metabase-url https://metabase.example.com \
    --metabase-api-key mb_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX= \
    --metabase-database business \
    --include-schemas public

Can you also support passing the database by numeric ID? For motivation, we have a multi-tenant environment where databases have the same display name and are tracked by ID. Allowing one to pass the database ID makes it possible for the tool to distinguish between those databases.

gouline commented 2 months ago

Since there's no way to distinguish databases with identical names in the Metabase UI, this seems like a rare hacky use case. I'll wait to see if anyone else upvotes this issue before considering it.

eskrm commented 2 months ago

Since there's no way to distinguish databases with identical names in the Metabase UI, this seems like a rare hacky use case. I'll wait to see if anyone else upvotes this issue before considering it.

The databases are managed programmatically by an admin user, and non-admin users are in groups that can only see one of the databases. But yeah, fair enough. Thanks.