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_branchwhere database_name = 'test';
select *from planetscale_database_branchwhere 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_branchwhere database_name = 'test' and parent_branch = 'main';
select *from planetscale_database_branchwhere database_name = 'test' and parent_branch = 'main';
Schema for planetscale_database_branch
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
access_host_url | text | Host name to access the database. | |
created_at | timestamp with time zone | When the branch was created. | |
database_name | text | = | Name of the database. |
name | text | = | Name of the branch. |
organization_name | text | =, !=, ~~, ~~*, !~~, !~~* | Name of the organization. |
parent_branch | text | Parent of this branch. | |
production | boolean | True if this branch is in production. | |
ready | boolean | True if the branch is ready. | |
region_slug | text | Region where the database is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
updated_at | timestamp with time zone | When 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