Skip to main content

Getting Started

Make sure to first set up your PlanetScale developer environment. Once you’ve installed the pscale CLI, you can interact with PlanetScale and manage your databases straight from the command line.

The query-patterns command

Download a CSV report of the query patterns for a database branch. The command creates a Query Insights report, waits for the report to finish generating, and writes the CSV file locally. Query pattern reports require Query Insights to be enabled for the database. Usage:

Available sub-commands

Available flags

Examples

Download a report with the default file name:
Download a report to a specific path:
Use JSON output for automation:
The JSON response includes the report ID, final state, and local file path:
If the branch is not found, or Query Insights is not enabled for the database, the command returns an error explaining both possible causes.

Need help?

Get help from the PlanetScale Support team, or join our Discord community to see how others are using PlanetScale.