One data model (dashbord) for different databases with the same structure

I have question
I have 3 databases with the same structure , would like to create one model that would work with each database (recall that the structure of these databases is the same difference that one is production , one is development ...) , then I would like to create a chart that will be parameterized depending on which database , based on several models and charts I would like to create one dashborad . This dashboard I would like to put in my SPA application , is it possible to parameterize by payload , which database this dashboard should use . E.g. on development environment it is to be a database from dev , on production environment it is to be a database from production , can I send the database ID via payload and then the user will get the correct data .

Thank you in advance for your feedback

Unfortunately no. Metabase ties a question with a specific data source, so they can't be changed on the fly (yet)

1 Like

Thank you for explaining .This information is very helpful .

And I have an additional question if we can somehow automate the migrations ie:
We currently have the structure of our database but in the future we plan to refactor probably this structure will change changing data models and charts on the development environment is not a problem but on the production environment for some time dashbord will not work because you will have to make changes in models etc.... Is there any way to speed it up e.g. use already prepared models from development environment .

The serialization feature was built for that specifically, I suggest you take a look at that

Thanks for advice

Simple way is to change the connection string to point to the new database hostname and db name etc, under "Metabase admin" -> "Databases" setting and click "Resync database Schema now" and/or "Rescan Field values". Vola, no change anywhere else in your "Question" or "SQL Query" or in the "Dashboard".