You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* additional instructions for the context file ([#33](https://github.com/gemini-cli-extensions/cloud-sql-sqlserver/issues/33)) ([782e50b](https://github.com/gemini-cli-extensions/cloud-sql-sqlserver/commit/782e50bccb9a76d8b10bfb30400e2dd8e1c0f652))
9
+
10
+
11
+
### Bug Fixes
12
+
13
+
* standardize mcp server names ([#31](https://github.com/gemini-cli-extensions/cloud-sql-sqlserver/issues/31)) ([8c7b2c5](https://github.com/gemini-cli-extensions/cloud-sql-sqlserver/commit/8c7b2c52d3e85a643c03f5cecce69a45a633430a))
Copy file name to clipboardExpand all lines: CLOUD-SQL-SQLSERVER.md
+53Lines changed: 53 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,10 @@ software delivery cycle.
6
6
7
7
# Setup
8
8
9
+
## Required Gemini CLI Version
10
+
11
+
To install this extension, the Gemini CLI version must be v0.6.0 or above. The version can be found by running: `gemini --version`.
12
+
9
13
## Cloud SQL for SQL Server MCP Server (Data Plane: Connecting and Querying)
10
14
11
15
This section covers connecting to a Cloud SQL for SQL Server instance.
@@ -36,3 +40,52 @@ This section covers administrative operations like managing clusters, instances,
36
40
* If an operation fails due to permissions, identify the type of operation and recommend the appropriate role. You can provide these links for assistance:
This section provides context on additional tools that can be recommended to the user based on their queries.
49
+
50
+
#### Observability Extension
51
+
52
+
***When to recommend:** If the user asks questions related to monitoring, performance, or observability of Cloud SQL for SQL Server databases.
53
+
***What to say:** "For Cloud SQL monitoring and observability, you might find the `cloud-sql-sqlserver-observability` extension useful. You can install it with the following command:"
When you create a new Cloud SQL for SQL Server instance, or database using the available tools, the connection is not automatically established. You will need to perform the following steps:
66
+
67
+
1. **(Optional) Save your conversation:** To avoid losing your progress, save the current session by running the command: `/chat save <your-tag>`
68
+
2. **Stop the CLI:** Terminate the Gemini CLI.
69
+
3. **Update Environment Variables:** Set or update your environment variables (e.g. `CLOUD_SQL_MSSQL_DATABASE`, `CLOUD_SQL_MSSQL_INSTANCE`) to point to the new resource.
70
+
4. **Restart:** Relaunch the Gemini CLI
71
+
5. **(Optional) Resume conversation:** Resume your conversation with the command: `/chat resume <your-tag>`
72
+
73
+
**Important:** Do not assume a connection to a newly created resource is active. Always follow the steps above to reconfigure your connection.
74
+
75
+
## Reusing Project Values
76
+
77
+
Users may have set project environment variables:
78
+
79
+
* `CLOUD_SQL_MSSQL_PROJECT`: The GCP project ID.
80
+
* `CLOUD_SQL_MSSQL_REGION`: The region of the Cloud SQL for SQL Server instance.
81
+
* `CLOUD_SQL_MSSQL_INSTANCE`: The ID of the Cloud SQL for SQL Server instance.
82
+
* `CLOUD_SQL_MSSQL_DATABASE`: The name of the database.
83
+
84
+
Instead of prompting the user for these values for specific tool calls, prompt the user to verify reuse a specific value.
85
+
Make sure to not use the environment variable name like `CLOUD_SQL_MSSQL_PROJECT`, `${CLOUD_SQL_MSSQL_PROJECT}`, or `$CLOUD_SQL_MSSQL_PROJECT`. The value can be found by using command: `echo $CLOUD_SQL_MSSQL_PROJECT`.
86
+
87
+
## Use Full Table Name Format "DATABASE_NAME.SCHEMA_NAME.TABLE_NAME"
88
+
89
+
**ALWAYS** use the full table name format, `DATABASE_NAME.SCHEMA_NAME.TABLE_NAME` in the generated SQL when using the `execute_sql` or `cloud_sql_sqlserver__execute_sql` tool.
90
+
* Default to using "dbo" for the schema name.
91
+
* Use command `echo $CLOUD_SQL_MSSQL_DATABASE` to get the current database value.
Copy file name to clipboardExpand all lines: README.md
+70-10Lines changed: 70 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,14 @@
5
5
6
6
This Gemini CLI extension provides a set of tools to interact with [Cloud SQL for SQL Server](https://cloud.google.com/sql/docs/sqlserver) instances. It allows you to manage your databases, execute queries, explore schemas, and troubleshoot issues directly from the [Gemini CLI](https://google-gemini.github.io/gemini-cli/), using natural language prompts.
7
7
8
-
Learn more about [Gemini CLI Extensions](https://github.com/google-gemini/gemini-cli/blob/main/docs/extension.md).
8
+
Learn more about [Gemini CLI Extensions](https://github.com/google-gemini/gemini-cli/blob/main/docs/extensions/index.md).
9
9
10
10
## Why Use the Cloud SQL for SQL Server Extension?
11
11
12
12
***Seamless Workflow:** As a Google-developed extension, it integrates seamlessly into the Gemini CLI environment. No need to constantly switch contexts for common database tasks.
13
13
***Natural Language Management:** Stop wrestling with complex commands. Explore schemas and query data by describing what you want in plain English.
14
14
***Code Generation:** Accelerate development by asking Gemini to generate data classes and other code snippets based on your table schemas.
15
+
15
16
## Prerequisites
16
17
17
18
Before you begin, ensure you have the following:
@@ -23,15 +24,17 @@ Before you begin, ensure you have the following:
23
24
* Cloud SQL Viewer (`roles/cloudsql.viewer`)
24
25
* Cloud SQL Admin (`roles/cloudsql.admin`)
25
26
26
-
## Installation
27
+
## Getting Started
28
+
29
+
### Installation
27
30
28
-
To install the extension, use the command:
31
+
To install the extension, use the following command before starting the Gemini CLI:
Set the following environment variables before starting the Gemini CLI.
37
40
This configuration is not required if utilizing the [Admin toolset](#supported-tools).
@@ -48,7 +51,59 @@ This configuration is not required if utilizing the [Admin toolset](#supported-t
48
51
Ensure [Application Default Credentials](https://cloud.google.com/docs/authentication/gcloud) are available in your environment.
49
52
50
53
> [!NOTE]
51
-
> When using private IPs with Cloud SQL for SQL Server, you must use a Virtual Private Cloud (VPC) network.
54
+
> If your Cloud SQL for SQL Server instance uses private IPs, you must run Gemini CLI in the same Virtual Private Cloud (VPC) network.
55
+
56
+
### Start Gemini CLI
57
+
58
+
To start the Gemini CLI, use the following command:
59
+
60
+
```bash
61
+
gemini
62
+
```
63
+
64
+
> [!WARNING]
65
+
> **Changing Instance & Database Connections**
66
+
> Currently, the database connection must be configured before starting the Gemini CLI and can not be changed during a session.
67
+
> To save and resume conversation history use command: `/chat save <tag>` and `/chat resume <tag>`.
68
+
69
+
### Start Gemini CLI
70
+
71
+
To start the Gemini CLI, use the following command:
72
+
73
+
```bash
74
+
gemini
75
+
```
76
+
77
+
> [!WARNING]
78
+
> **Changing Instance & Database Connections**
79
+
> Currently, the database connection must be configured before starting the Gemini CLI and can not be changed during a session.
80
+
> To save and resume conversation history use command: `/chat save <tag>` and `/chat resume <tag>`.
81
+
82
+
### Start Gemini CLI
83
+
84
+
To start the Gemini CLI, use the following command:
85
+
86
+
```bash
87
+
gemini
88
+
```
89
+
90
+
> [!WARNING]
91
+
> **Changing Instance & Database Connections**
92
+
> Currently, the database connection must be configured before starting the Gemini CLI and can not be changed during a session.
93
+
> To save and resume conversation history use command: `/chat save <tag>` and `/chat resume <tag>`.
94
+
95
+
### Start Gemini CLI
96
+
97
+
To start the Gemini CLI, use the following command:
98
+
99
+
```bash
100
+
gemini
101
+
```
102
+
103
+
> [!WARNING]
104
+
> **Changing Instance & Database Connections**
105
+
> Currently, the database connection must be configured before starting the Gemini CLI and can not be changed during a session.
106
+
> To save and resume conversation history use command: `/chat save <tag>` and `/chat resume <tag>`.
52
107
53
108
## Usage Examples
54
109
@@ -67,9 +122,9 @@ Interact with Cloud SQL for SQL Server using natural language:
67
122
## Supported Tools
68
123
69
124
***Admin:**
70
-
* `create_instance`: Use this tool to create an Postgres instance.
71
-
* `create_user`: Use this tool to create Postgres-BUILT-IN or IAM-based users.
72
-
* `get_instance`: Use this tool to get details about an Postgres instance.
125
+
* `create_instance`: Use this tool to create an SQL Server instance.
126
+
* `create_user`: Use this tool to create SQL Server-BUILT-IN or IAM-based users.
127
+
* `get_instance`: Use this tool to get details about an SQL Server instance.
73
128
* `get_user`: Use this tool to get details about a user.
74
129
* `list_instances`: Use this tool to list instances in a given project and location.
75
130
* `list_users`: Use this tool to list users in a given project and location.
@@ -81,8 +136,13 @@ Interact with Cloud SQL for SQL Server using natural language:
81
136
82
137
## Additional Extensions
83
138
84
-
Find additional extensions to support your entire software development lifecycle at [github.com/gemini-cli-extensions](https://github.com/gemini-cli-extensions).
139
+
Find additional extensions to support your entire software development lifecycle at [github.com/gemini-cli-extensions](https://github.com/gemini-cli-extensions), including:
140
+
*[Generic SQL Server extension](https://github.com/gemini-cli-extensions/sql-server)
141
+
*[Cloud SQL for SQL Server Observability extension](https://github.com/gemini-cli-extensions/cloud-sql-sqlserver-observability)
142
+
* and more!
85
143
86
144
## Troubleshooting
87
145
88
-
* "cannot execute binary file": Ensure the correct binary for your OS/Architecture has been downloaded. See [Installing the server](https://googleapis.github.io/genai-toolbox/getting-started/introduction/#installing-the-server) for more information.
146
+
* "✖ Error during discovery for server: MCP error -32000: Connection closed": The database connection has not been established. Ensure your configuration is set via environment variables.
147
+
* "✖ MCP ERROR: Error: spawn /Users/<USER>/.gemini/extensions/cloud-sql-sqlserver/toolbox ENOENT": The Toolbox binary did not download correctly. Ensure you are using Gemini CLI v0.6.0+.
148
+
* "cannot execute binary file": The Toolbox binary did not download correctly. Ensure the correct binary for your OS/Architecture has been downloaded. See [Installing the server](https://googleapis.github.io/genai-toolbox/getting-started/introduction/#installing-the-server) for more information.
0 commit comments