steampipe plugin install gcp

Table: gcp_sql_database - Query Google Cloud SQL Databases using SQL

Google Cloud SQL is a fully-managed database service that makes it easy to set up, maintain, manage, and administer relational databases on Google Cloud. It provides a cloud-based alternative to traditional on-premise databases, supporting both MySQL and PostgreSQL. Google Cloud SQL Databases offer high performance, scalability, and convenience.

Table Usage Guide

The gcp_sql_database table provides insights into databases within Google Cloud SQL. As a database administrator or cloud engineer, you can explore database-specific details through this table, including the database name, instance, charset, and collation. Use it to manage and monitor your SQL databases efficiently, ensuring optimal performance and security.

Examples

Basic info

Explore the character set and collation configurations of your Google Cloud Platform SQL databases to ensure they align with your data encoding and sorting requirements. This can help maintain data integrity and prevent potential issues related to character representation and comparison.

select
name,
instance_name,
charset,
collation
from
gcp_sql_database;
select
name,
instance_name,
charset,
collation
from
gcp_sql_database;

Get the SQL Server version with which the database is to be made compatible

Determine the compatibility level of your database with different versions of SQL Server. This can be useful for planning version upgrades or ensuring backward compatibility with older versions.

select
name,
sql_server_database_compatibility_level
from
gcp_sql_database;
select
name,
sql_server_database_compatibility_level
from
gcp_sql_database;

Count of databases per instance

Analyze the settings to understand the distribution of databases across different instances. This can help in assessing the load distribution and managing resources more effectively.

select
instance_name,
count(*) as database_count
from
gcp_sql_database
group by
instance_name;
select
instance_name,
count(*) as database_count
from
gcp_sql_database
group by
instance_name;

Schema for gcp_sql_database

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
charsettextSpecifies the MySQL charset value.
collationtextSpecifies the MySQL collation value.
instance_nametext=The name of the Cloud SQL instance.
kindtextThe type of the resource.
locationtextThe GCP multi-region, region, or zone in which the resource is located.
nametext=A friendly name that identifies the resource.
projecttext=, !=, ~~, ~~*, !~~, !~~*The GCP Project in which the resource is located.
self_linktextThe server-defined URL for the resource.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
sql_server_database_compatibility_levelbigintThe version of SQL Server with which the database is to be made compatible.
sql_server_database_recovery_modeltextThe recovery model of a SQL Server database.
titletextTitle of the resource.

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)" -- gcp

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

steampipe_export_gcp --config '<your_config>' gcp_sql_database