> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corelayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PlanetScale Integration

> Connect your PlanetScale database to Corelayer to enable intelligent querying and debugging with your application data.

## Prerequisites

* A PlanetScale account with active databases
* Permission to create credentials in your PlanetScale database

## Step-by-Step Setup

### 1. Navigate to Integrations

In your Corelayer dashboard, go to the **Integrations** page.

### 2. Add PlanetScale Integration

Click the **Add Integration** button and select **PlanetScale** from the list of available integrations.

### 3. Select Database Engine

Choose the engine your PlanetScale database uses:

* **MySQL** — Standard PlanetScale MySQL-compatible databases
* **Postgres** — PlanetScale Postgres-compatible databases

### 4. Create PlanetScale Credentials

In your PlanetScale dashboard:

1. Go to your database
2. Navigate to **Settings > Passwords**
3. Create a new password for Corelayer with read-only access
4. Copy the connection details

### 5. Enter Connection Details

Provide the following:

* **Host** — Your PlanetScale database host
* **Database** — The database name
* **Username** — The credential username
* **Password** — The credential password

### 6. Configure Replica (Optional)

If you have a read replica, you can optionally provide replica connection details. This allows Corelayer to query your replica instead of the primary database, reducing load on production:

* **Replica Host** — Your replica hostname
* **Replica Database** — The replica database name
* **Replica Username** — Replica credentials
* **Replica Password** — Replica password

### 7. Test Connection

Click **Test Connection** to verify that Corelayer can connect to your PlanetScale database (and replica, if configured).

### 8. Select Tables

Once connected, Corelayer will discover your schemas and tables:

* Browse the list of available schemas and tables
* Select the tables you want Corelayer to have access to
* Click **Update Selection**

### 9. Add PlanetScale Tables to Your Service Maps

When configuring your Corelayer Service Maps, select which PlanetScale tables are relevant to each service.

## What Corelayer Can Do With PlanetScale

Once connected, Corelayer will:

* Query your selected tables to gather context during debugging
* Analyze data patterns to identify anomalies related to reported issues
* Use read replicas (if configured) to avoid impacting production performance
* Correlate database data with logs and errors from other integrations

## Managing Your Integration

### Disconnecting

To disconnect your PlanetScale integration:

1. Navigate to Settings > Integrations
2. Find your PlanetScale integration and click **Uninstall**
3. Confirm the uninstallation
4. Optionally, revoke the credentials in your PlanetScale dashboard

## Troubleshooting

### Integration Not Working?

* Verify the connection details (host, database, username, password) are correct
* Ensure the credentials have read access to the selected tables
* Check that your PlanetScale database is active and accessible
* If using a replica, verify the replica connection details separately
* Confirm SSL/TLS is properly configured for your connection

Need help? [Contact support](mailto:support@corelayer.com) for assistance with your PlanetScale integration.
