How to Integrate Metabase and PlanetScale Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Integrating metabase and planetscale lets teams run visual analytics on MySQL data. Metabase sends SQL queries to a PlanetScale database branch and builds charts from the results. This setup helps business users check metrics without writing code or changing live tables. How metabase and planetscale handle logins and data flow To link the two tools, you create a database password inside PlanetScale. You give that user a role that matches the task at hand. Then you add the host address, user n

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Integrating metabase and planetscale lets teams run visual analytics on MySQL data. Metabase sends SQL queries to a PlanetScale database branch and builds charts from the results. This setup helps business users check metrics without writing code or changing live tables.

How metabase and planetscale handle logins and data flow

To link the two tools, you create a database password inside PlanetScale. You give that user a role that matches the task at hand. Then you add the host address, user name, and password into the Metabase admin screen.

Once linked, Metabase scans the tables and columns in your database branch. It stores table names so users can build charts with simple clicks. When a user opens a dashboard, Metabase builds a SQL query and sends it over TLS.

PlanetScale runs the query and returns the matching rows to the analytics app. Every user who runs a query in Metabase shares that one database login. The database sees the shared service account, not the person clicking the chart.

Common risks with shared accounts and broad permissions

Many teams use a single admin password when they set up their analytics tool. If someone leaks that password, an attacker can read or delete production tables. A broad role also lets users run heavy queries that slow down the main app.

Shared logins also hide who ran a specific query in the database logs. If a dashboard pulls sensitive user records, the database log only shows the Metabase account. Security teams cannot trace that query back to an individual analyst.

Another risk comes from raw customer data sitting in production tables. Analysts often need to count rows, not read personal emails or phone numbers. Yet a basic database link returns every column the shared role can read by default.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Scoping database roles and network paths

Start by creating a read-only credential in PlanetScale just for analytics work. Never reuse the password that your main web app uses to write data. If your database plan supports read replicas, point Metabase to a replica so heavy charts do not slow down writes.

Next, lock down which tables the analytics role can read. Hide auth tables, billing records, and secret keys from the reporting tool. You can also create database views that leave out sensitive columns like card numbers or national IDs.

Restrict network traffic so only your Metabase server IP can reach the database host. Rotate the database password on a set schedule and remove old keys right away. Check your query logs each week to spot slow charts and odd data pulls.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Should Metabase use a read-only PlanetScale credential?

Yes, always give your analytics tool a read-only database role. Reporting tools only need to read rows, not change or delete them. A read-only role stops accidental data loss if a user runs raw SQL.

How do we stop heavy dashboards from slowing down our main app?

Send analytics queries to a read replica instead of your primary database node. This keeps slow group queries and large table scans away from live user writes. You can also set query timeouts so bad charts fail fast.

How can we protect personal data in Metabase charts?

Limit table permissions so the reporting user only reads safe columns. You can also apply data masking to rewrite emails, phone numbers, and card numbers in query results. This lets analysts build charts while keeping personal records safe.

The query runs. The emails stay hidden.