Table: planetscale_database - Query PlanetScale Databases using SQL
PlanetScale is a database as a service that provides a scalable, transactional, and serverless relational database built on MySQL and Kubernetes. It allows for easy database management and operations, including creating, deploying, and scaling databases. It is designed to handle heavy traffic, large datasets, and to provide high availability and strong consistency.
Table Usage Guide
The planetscale_database
table provides insights into databases within PlanetScale. As a database administrator or a DevOps engineer, explore database-specific details through this table, including configurations, branches, and connection strings. Utilize it to uncover information about databases, such as their operational status, deployment details, and to manage database versions and configurations.
Examples
List all databases
Explore all the databases available in your system to understand their structure and organization. This could help in managing data more efficiently and making informed decisions for data manipulation or migration.
select *from planetscale_database;
select *from planetscale_database;
Databases created in the last week
Discover the databases that have been established within the past week. This can be beneficial for monitoring recent activity and assessing the growth of your data infrastructure.
select *from planetscale_databasewhere age(created_at) < interval '7 days';
select *from planetscale_databasewhere julianday('now') - julianday(created_at) < 7;
Databases in US regions
Explore which databases are located in US regions to optimize data management and improve latency. This can be beneficial in enhancing user experience and ensuring efficient data access.
select *from planetscale_databasewhere region like 'us-%';
select *from planetscale_databasewhere region like 'us-%';
Schema for planetscale_database
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
created_at | timestamp with time zone | When the database was created. | |
name | text | = | Name of the database. |
notes | text | Notes for the database. | |
region_slug | text | Region where the database is located. | |
updated_at | timestamp with time zone | When the database 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