Linking PlanetScale as a source
Let AI connect your sources for you
Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

This source is currently in alpha. The interface and available tables may change.
The PlanetScale connector links your PlanetScale database tables to PostHog, so you can query them alongside your product data. PlanetScale offers both MySQL and Postgres databases, and PostHog has a source for each.
Prerequisites
A PlanetScale database, and a role or password with read access to the tables you want to sync. PostHog only reads data, so read access is enough.
Adding a data source
- In PostHog, go to the Sources tab of the data pipeline section.
- Click + New source and click Link next to this source.
- Enter your credentials (see Configuration below) and click Next.
- Select the tables you want to sync, choose a sync method and frequency, then click Import.
Once the syncs are complete, you can start querying this data in PostHog.
Pick PlanetScale MySQL or PlanetScale Postgres to match your database.
PlanetScale MySQL
In the PlanetScale dashboard, open your database, pick the branch, and click Connect. Create a password there and copy the host, username, and password it shows.
- Host: looks like
aws.connect.psdb.cloud. - Port:
3306. - Database: the database name, shown in the connection details.
- Username and Password: the credentials created by Connect.
- Schema: optional. Leave blank to include every database on the branch.
PlanetScale Postgres
In the PlanetScale dashboard, open your database and click Connect to create a role and read its connection details. You can paste the whole connection string instead of filling the fields one by one.
- Host: looks like
xxxxxxxxxx-useast1-1.horizon.psdb.cloud. - Port: use
5432for a direct connection. Port6432goes through PSBouncer, which works for standard syncs but not for change data capture. PSBouncer pools in transaction mode, and logical replication cannot run over it. - Database: the database name, usually
postgres. - User: PlanetScale usernames carry the branch id, so they look like
postgres.xxxxxxxxxx. - Password: the password for that role.
- Schema: optional, defaults to
public.
PlanetScale always connects over TLS, which PostHog uses by default.
Sync modes
Each table can be synced in one of several modes, depending on what the source supports:
- Webhook (when available) – the source pushes changes to PostHog in real time. Fastest freshness, lowest ongoing cost, and the only mode that reliably captures updates and deletes.
- Incremental – only new or updated rows are synced on each run, using a cursor field (such as an
updated_attimestamp). Cheaper than a full refresh, but deletes aren't captured. - Append only – new rows are appended using a cursor field; existing rows are never updated. Ideal for immutable, append-only tables like event logs.
- Full refresh – the whole table is reloaded on every sync. Use it when a table has no reliable cursor or when you need deletions reflected.
See sync methods for a full explanation of how each mode works and how to choose between them.
Configuration
| Option | Description |
|---|---|
HostType: text Required: True | In the PlanetScale dashboard, open your database, pick the branch, and click Connect. Create a password there and copy the host, username, and password it shows. The host looks like |
PortType: number Required: True | |
DatabaseType: text Required: True | The PlanetScale database name, shown in the connection details. |
UsernameType: text Required: True | |
PasswordType: password Required: True | |
SchemaType: text Required: False |
Supported tables
The tables available from this source are discovered from your account when you connect it, so the exact list depends on your data. Once connected, you can pick which tables to sync from the sources tab.
Troubleshooting
- If the connection fails with an authorization error, the username or password is wrong or has been revoked. Create new credentials with Connect in the PlanetScale dashboard, then reconnect the source.
- If PostHog cannot reach your database, check that PlanetScale allows connections from the PostHog IP addresses below.
Inbound IP addresses
We use a set of IP addresses to access your instance. To ensure this connector works, add these IPs to your inbound security rules:
| US | EU |
|---|---|
| 44.205.89.55 | 3.75.65.221 |
| 52.4.194.122 | 18.197.246.42 |
| 44.208.188.173 | 3.120.223.253 |
If your sync is failing or data looks wrong, see the Data warehouse troubleshooting guide. If that doesn't help, contact support – we're happy to help.