Overview
Hightouch supports PlanetScale databases as a data source and a destination to send data to. This article will provide an overview of setting up a PlanetScale database as a source and destination. Connecting your PlanetScale database to a Hightouch workflow can be used in a number of different ways, but here are a few ideas to get you started:- Automatically update customer records in your CRM when they are created or changed in your database.
- Send a notification to your Slack workspace when data is changed in your PlanetScale database.
- Execute asynchronous operations by sending data from your PlanetScale database to a data queue like AWS SQS.
- Automate paid ad targeting, suppression, and conversion uploads by syncing audiences from your database to ad platforms.
- Automatically sync account and user health scores to your customer success platforms.
PlanetScale as a source
If you wish to sync data from your PlanetScale database to another system, you’ll need to configure your PlanetScale database as a source in Hightouch. I will be using a database namedbookings_db
in this demo.
1. Create the source
In Hightouch, start by selecting “Sources” from the sidebar.


NoteAs a reminder, PlanetScale credentials can be generated by clicking “Connect” in the PlanetScale dashboard overview of your database. Review our Connection strings doc for more details.




2. Create a model
Before you can start syncing data, you need to tell Hightouch how the data looks with a Model. Start by selecting “Models” from the navigation.

- SQL query - allows you to write a SQL query that returns the data you want to sync.
- Table selector - allows you to select a table and read every row in it.

hotels
table, select it from the list, and click “Preview results” to validate the data in that table. Once satisfied with the results, click “Continue”.

id
before clicking “Finish”.

3. Create a sync
Now that the Source and Model are configured, a Sync can be created which will sync data from PlanetScale to another system. For this demo, I’ll be using a spreadsheet in my Google Drive account that I’ve already configured as a destination. Select “Syncs” from the left and click “Add sync”.





4. Review the synced data
If I log into my Google Drive account and review that spreadsheet, there are now three rows that exist which match the data from thehotels
table of my PlanetScale database.

PlanetScale as a destination
Hightouch can also be configured to send data to a PlanetScale database. In this demo, I’ll perform the inverse of the above demo and configure thenew hotels
sheet from my Google Sheets spreadsheet to add new rows to my PlanetScale database.
Here is that sheet with a single new hotel added to it.

1. Create the Destination
Configuring the source and model for Google Sheets will not be covered in this demo. I’ll start by creating a new destination for my PlanetScale database by selecting “Destinations” from the left navigation, then “Add destination”.



2. Create the Sync
To create a new Sync, select “Syncs” from the left navigation and click “Add sync”.
new_hotel
so I’ll select that from the list.


hotels
from the dropdown. Hightouch only supports upserting data at this time, so that option is preselected. I’ll also need to map the fields between my Google Sheets worksheet and my PlanetScale database, starting with the unique identifiers.
Both have an id
column so I can select that for both sides of the sync. Since the other column names match, I can click “Suggest mappings” to let Hightouch automatically figure out which fields map from the Source to the Destination. Once that’s done, I’ll click “Continue” to move forward.



3. Review the synced data
I can verify that the sync was successful by querying my PlanetScale database to ensure the new hotel was added successfully.