turbot/planetscale
steampipe plugin install planetscale

Table: planetscale_database_branch - Query PlanetScale Database Branches using SQL

PlanetScale is a database platform that allows you to create, scale, and manage databases for your applications. A PlanetScale Database Branch is a version of your database that you can modify without affecting the main database. It is used for testing changes, debugging issues, and developing new features without risking the stability of your production database.

Table Usage Guide

The planetscale_database_branch table provides insights into the branches of databases within PlanetScale. As a database administrator or developer, explore branch-specific details through this table, including the branch's configuration, status, and associated metadata. Utilize it to uncover information about branches, such as their creation time, update time, and the readiness status of the branch.

Examples

List all branches for all databases

Explore the various branches across all your databases to manage and keep track of different versions of your data effectively. This aids in making informed decisions for version control and data integrity.

select
*
from
planetscale_database_branch;
select
*
from
planetscale_database_branch;

List branches for a specific database

Explore the different branches within a specific database to understand its various versions or instances. This is useful for managing changes and updates to the database.

select
*
from
planetscale_database_branch
where
database_name = 'test';
select
*
from
planetscale_database_branch
where
database_name = 'test';

Branches derived from the main branch

Discover the segments that have been created from the main branch in a specific database, which can be useful when tracking the evolution of your data and managing your database structure.

select
*
from
planetscale_database_branch
where
database_name = 'test'
and parent_branch = 'main';
select
*
from
planetscale_database_branch
where
database_name = 'test'
and parent_branch = 'main';

Schema for planetscale_database_branch

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
access_host_urltextHost name to access the database.
created_attimestamp with time zoneWhen the branch was created.
database_nametext=Name of the database.
nametext=Name of the branch.
organization_nametextName of the organization.
parent_branchtextParent of this branch.
productionbooleanTrue if this branch is in production.
readybooleanTrue if the branch is ready.
region_slugtextRegion where the database is located.
updated_attimestamp with time zoneWhen the branch was updated.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- planetscale

You can pass the configuration to the command with the --config argument:

steampipe_export_planetscale --config '<your_config>' planetscale_database_branch