All skills
google avatar

/cloud-sql-basics

@becc4b8
by googlegoogle/skills21k stars
1,698

This file generates or explains Cloud SQL resources. Use this file when the user asks to create a Cloud SQL instance or database for MySQL, PostgreSQL, or SQL Server. Cloud SQL manages third-party MySQL, PostgreSQL, and SQL Server instances as resources in Cloud SQL. For example, when Cloud SQL creates an open-source MySQL instance, the resulting resource is a Cloud SQL for MySQL instance that Google Cloud manages. Cloud SQL handles backups, high availability, and secure connectivity for relational database workloads.

Use this Skill: https://skilld.dev/gh/google/skills/cloud-sql-basics

This session only. Nothing lands on disk.

referencesclient-library-usage.md

≈735 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Cloud SQL Client Libraries

Google Cloud provides client libraries and connectors to simplify connecting to Cloud SQL from various programming languages.

Getting Started

Ensure you have the latest version of the Google Cloud SDK installed and authenticated. Install Google Cloud SDK

Language Connectors

The Cloud SQL Language Connectors (Python, Java, Go, Node.js) provide a secure way to connect to the Cloud SQL instance without managing IP allowlists or SSL certificates.

Python
  • Installation for a Cloud SQL for PostgreSQL instance:

    pip install "cloud-sql-python-connector[pg8000]"
  • Usage Example:

    from google.cloud.sql.connector import Connector
    connector = Connector()
    def getconn():
      conn = connector.connect(
          "project:region:instance",
          "pg8000",
          user="my-user",
          password="my-password",
          db="my-db"
      )
      return conn
Java
  • Maven Dependencies:

    The recommended method is to use the Cloud SQL JDBC Socket Factory. Add the BOM to your <dependencyManagement> section:

    <dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>com.google.cloud.sql</groupId>
          <artifactId>jdbc-socket-factory-bom</artifactId>
          <version>1.18.0</version>
          <type>pom</type>
          <scope>import</scope>
        </dependency>
      </dependencies>
    </dependencyManagement>

    Then add dependencies for your database:

    • PostgreSQL:

      <dependencies>
        <dependency>
          <groupId>org.postgresql</groupId>
          <artifactId>postgresql</artifactId>
          <version>42.7.3</version>
        </dependency>
        <dependency>
          <groupId>com.google.cloud.sql</groupId>
          <artifactId>postgres-socket-factory</artifactId>
        </dependency>
      </dependencies>
    • MySQL:

      <dependencies>
        <dependency>
          <groupId>com.mysql</groupId>
          <artifactId>mysql-connector-j</artifactId>
          <version>8.0.33</version>
        </dependency>
        <dependency>
          <groupId>com.google.cloud.sql</groupId>
          <artifactId>mysql-socket-factory-connector-j-8</artifactId>
        </dependency>
      </dependencies>
Node.js (TypeScript)
  • Installation:

    npm install @google-cloud/cloud-sql-connector
Go
  • Installation:

    go get cloud.google.com/go/cloudsqlconn

Cloud SQL Admin API

To manage Cloud SQL resources (e.g., list instances) programmatically, use the sqladmin libraries.

Source: SKILL.md on GitHub

No alerts10d3 checks · Risk SAFE
  • Gen Agent Trust Hub10d

    This skill provides comprehensive documentation and administrative patterns for managing Google Cloud SQL resources. It includes security-focused guidance on the principle of least privilege, IAM-based authentication, and secure connectivity practices. While the skill references external package installations and powerful administrative tools, these are standard components of the service and are documented alongside relevant security considerations.

  • Socket10d

    No alerts

  • Snyk10d

    Risk: LOW · No issues

Signed by skilld at becc4b8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 weeks ago
metadata
{
  "version": "1.0.0",
  "category": "Databases"
}

README badge

README badge for google/skills/cloud-sql-basics