Test existing question


I plan to use Metabase. I would like to know if there is some advises or best practice to follow in order to check that question written in Metabase stays consistent when the database change.

My idea was to feed Metabase with a dump of our database and somehow export all the question results and then check if the results are correct.

Is there any resources I can read about that topic?

Hi @charles

I’m not quite sure what you’re trying to do, since Metabase should return the same results, since Metabase is doing queries to your database and isn’t a database warehouse.

If you make structural changes (changing tables/columns), then you need to synchronize the database via Settings > Admin > Database, but this is done every 24 hours automatically.

But if you want to verify that a question returns the same data, then you could do that via the API. And with the result, you would then compare it to your own database query result.
You probably want to look at this API:

POST /api/card/:card-id/query/:export-format

Read more about the API here:

Thanks @flamber!

Since Metabase is not part of the application, it can be forgotten when it come to database schema changes. I just want to make sure we get an alert if Metabase do not return the same result after we change the database schema.

Does this make more sense to you? :wink:

Ahh, I see. Then you would probably want to validate the schema every few minutes and create an alert or have it force-sync the schema, when there’s a change via POST /api/database/:id/sync