|
| 1 | +# Gemini CLI Extension - Cloud SQL for PostgreSQL |
| 2 | + |
| 3 | +This Gemini CLI extension provides a set of tools to interact with [Cloud SQL for PostgreSQL](https://cloud.google.com/sql/docs/postgres) instances. It allows you to manage your databases, execute queries, and explore schemas directly from the [Gemini CLI](https://google-gemini.github.io/gemini-cli/), using natural language prompts. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +* **Integrated with Gemini CLI:** As a Google-developed extension, it integrates seamlessly into the Gemini CLI environment, making security an accessible part of your workflow. |
| 8 | +* **Connect to Cloud SQL for PostgreSQL:** Securely connect to your Cloud SQL for PostgreSQL instances. |
| 9 | +* **Explore Database Schema:** List databases, tables, views, and schemas. |
| 10 | +* **Query your Database:** Execute SQL queries against your database. |
| 11 | + |
| 12 | +## Supported Tools |
| 13 | + |
| 14 | +🟢 list-tables: Use this tool to list tables and descriptions. |
| 15 | +🟢 execute-sql: Use this tool to execute any SQL statement. |
| 16 | +🚧 cloudsql-wait-for-operation: Polls the operations API until an operation is complete. |
| 17 | +🚧 cloudsql-user-create: Use this tool to create a new user for a Cloud SQL instance. |
| 18 | +🚧 cloudsql-database-list: Use this tool to list databases within a Cloud SQL instance. |
| 19 | +🚧 cloudsql-database-create: Use this tool to create a new database within a Cloud SQL instance. |
| 20 | +🚧 cloudsql-instance-list: Use this tool to list Cloud SQL instances in a given project and location. |
| 21 | +🚧 cloudsql-instance-get: Use this tool to get details about a specific Cloud SQL instance. |
| 22 | +🚧 cloudsql-instance-create: Use this tool to create (insert) a new Cloud SQL instance. |
| 23 | +🔜 csql-postgresql-system-metrics: Use this tool to retrieve system metrics for a Cloud SQL for PostgreSQL instance. |
| 24 | +🔜 csql-postgresql-query-metrics: Use this tool to retrieve query-related metrics for a Cloud SQL for PostgreSQL instance. |
| 25 | + |
| 26 | +## Prerequisites |
| 27 | + |
| 28 | +Before you begin, ensure you have the following: |
| 29 | + |
| 30 | +* [Gemini CLI](https://github.com/google-gemini/gemini-cli) installed. |
| 31 | +* A Google Cloud project with the **Cloud SQL Admin API** enabled. |
| 32 | +* IAM Permissions |
| 33 | + |
| 34 | +## Installation |
| 35 | + |
| 36 | +To install the extension, use the `gemini extensions install` command: |
| 37 | + |
| 38 | +```bash |
| 39 | +gemini extensions install github.com/gemini-cli-extensions/cloud-sql-postgresql.git |
| 40 | +``` |
| 41 | + |
| 42 | +## Configuration |
| 43 | + |
| 44 | +* `CLOUD_SQL_POSTGRES_PROJECT`: The GCP project ID. |
| 45 | +* `CLOUD_SQL_POSTGRES_REGION`: The region of your Cloud SQL instance. |
| 46 | +* `CLOUD_SQL_POSTGRES_INSTANCE`: The ID of your Cloud SQL instance. |
| 47 | +* `CLOUD_SQL_POSTGRES_DATABASE`: The name of the database to connect to. |
| 48 | +* `CLOUD_SQL_POSTGRES_USER`: (Optional) The database username. |
| 49 | +* `CLOUD_SQL_POSTGRES_PASSWORD`: (Optional) The password for the database user. |
| 50 | +* `CLOUD_SQL_POSTGRES_IP_TYPE`: (Optional) The IP Type. |
| 51 | + |
| 52 | + |
| 53 | +## Usage |
| 54 | + |
| 55 | +* Provision Infrastructure |
| 56 | +* Explore Schemas and Data |
| 57 | +* Generate code |
| 58 | + |
| 59 | + |
| 60 | +## Security |
| 61 | + |
| 62 | +This extension executes commands against your Cloud SQL for PostgreSQL database. Always review the generated SQL queries before execution, especially for write operations. |
| 63 | + |
| 64 | +## Disclaimer |
| 65 | + |
| 66 | +This is not an officially supported Google product. This extension is under active development, and breaking changes may be introduced. |
0 commit comments