The Scenario
You're a BI engineer responsible for a quarterly data governance review. The scope this quarter: row counts for 12 key tables across three Metabase-connected databases, compiled into a single Excel workbook. In theory, simple. In practice, it means running four queries per database, switching between three database contexts in Metabase, and manually recording the results — while the compliance deadline is tomorrow morning.
The bad version:
- Open Metabase, navigate to the SQL editor, select the first database, run SELECT COUNT(*) FROM table_name for each of the four tables.
- Note the results. Switch to the second database. Run the same queries. Switch to the third. Repeat.
- Open the Excel workbook, create rows for each table across all three databases, and type in the twelve numbers you just pulled from three separate browser contexts.
This is 25 minutes on a good day. The day a database connection times out and you have to reconnect mid-session, it's 45 — and you're not sure if the count from database 2, table 3 was 182,447 or 182,474.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent that lives inside your Excel workbook. It can run SQL against multiple Metabase-connected databases in a single prompt and compile the results into the workbook without you touching a second browser tab.
List all Metabase databases and write their ID, name, and engine type into Sheet1, then for each database run SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'public' and write the table count into column D
What You Get
- Sheet1 has one row per database: ID, name, engine type, and public schema table count.
- All queries run against the live databases.
- If a database is unreachable, SheetXAI notes the error in column D rather than leaving it blank.
What If the Data Is Not Quite Ready
You're driving the table list from the workbook itself
For each database ID in column A of this workbook, execute the SQL in column B against that Metabase database and write the result row count and first result value into columns C and D
Maintain the query list in the workbook — useful when the 12 target tables change from review to review.
You need engine type and version info alongside the counts
List all Metabase databases and write name, engine, and database version into columns A through C, then for each database run SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'public' and write the count into column D
The governance report gets structural metadata and content stats in one pass.
You want separate worksheets per database
Query Metabase databases 1, 3, and 2 in that order. For each one run SELECT table_name, COUNT(*) as row_count FROM information_schema.tables WHERE table_schema = 'public' GROUP BY table_name and write the results into a worksheet named after the database
Table-level granularity, organized by database, without a mixed list that requires filtering.
Full audit with summary in one shot
For each database ID in column A of this workbook, run SELECT table_name, COUNT(*) FROM information_schema.tables WHERE table_schema = 'public' GROUP BY table_name against that Metabase database and write results into Sheet1 with a database_id column prepended. In Sheet2 write one row per database: database name, total table count, and total estimated row count.
Detail and summary in two worksheets. The governance meeting gets both.
Try It
Get the 7-day free trial of SheetXAI and open the Excel workbook for your governance review, then ask it to query all three Metabase databases and compile the results in one pass. Also useful: exporting a Metabase data dictionary into a workbook, and the hub overview on connecting Metabase to Excel.
