Skip to content

feat: add the Gemini Data Analytics (GDA) integration for DB NL2SQL conversion to Toolbox#2181

Merged
wangauone merged 12 commits into
mainfrom
gda-integration
Dec 18, 2025
Merged

feat: add the Gemini Data Analytics (GDA) integration for DB NL2SQL conversion to Toolbox#2181
wangauone merged 12 commits into
mainfrom
gda-integration

Conversation

@wangauone

Copy link
Copy Markdown
Contributor

Description

This PR is to add the Gemini Data Analytics (GDA) integration for DB NL2SQL conversion to Toolbox. It allows the user to convert a natural language query to SQL statement based on their database instance. See the doc section for details.

PR Checklist

Thank you for opening a Pull Request! Before submitting your PR, there are a
few things you can do to make sure it goes smoothly:

  • Make sure you reviewed
    CONTRIBUTING.md
  • Make sure to open an issue as a
    bug/issue
    before writing your code! That way we can discuss the change, evaluate
    designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Make sure to add ! if this involve a breaking change

🛠️ Fixes #2180

@wangauone wangauone requested a review from a team December 15, 2025 19:39
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @wangauone, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Toolbox by adding a new capability to convert natural language queries into SQL statements using the Gemini Data Analytics API. This feature is exposed through a new configurable source and a powerful query tool, expanding the platform's ability to interact with various Google Cloud databases like AlloyDB, Spanner, and CloudSQL, making data interaction more intuitive for users.

Highlights

  • Gemini Data Analytics (GDA) Integration: This pull request introduces the integration of Gemini Data Analytics (GDA) into the Toolbox, enabling natural language to SQL conversion for database instances.
  • New Source: cloud-gemini-data-analytics: A new source kind, cloud-gemini-data-analytics, has been added to facilitate interaction with the Gemini Data Analytics API. It supports authentication via Application Default Credentials (ADC) or client-side OAuth.
  • New Tool: cloud-gemini-data-analytics-query: A new tool, cloud-gemini-data-analytics-query, is now available. This tool allows users to send natural language questions to the GDA API, receiving structured responses including SQL queries, natural language answers, and explanations. It currently supports AlloyDB, Spanner, and CloudSQL databases.
  • Dependency Updates: The go.mod file has been updated to use cloud.google.com/go/geminidataanalytics v0.3.0 and a newer version of google.golang.org/genproto/googleapis/api.
  • Comprehensive Documentation and Testing: New documentation files have been added for both the GDA source and tool, along with dedicated unit and integration tests to ensure the new functionality is robust and correctly implemented.
Ignored Files
  • Ignored by pattern: go.sum (1)
    • go.sum
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an integration for Gemini Data Analytics (GDA), allowing natural language queries to be converted to SQL. The changes include a new source, a new tool, corresponding documentation, and tests. The implementation is solid, but I've found a minor issue in the source implementation regarding user agent handling where an error is ignored and a value is refetched unnecessarily. I've provided a suggestion to improve the robustness and efficiency of this part.

Comment thread internal/sources/cloudgda/cloud_gda.go Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Comment thread docs/en/resources/tools/cloudgda/cloud-gda-query.md Outdated

@g-lynnzee g-lynnzee left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What kind of E2E testing have we done on this tool?

Comment thread docs/en/resources/tools/cloudgda/cloud-gda-query.md Outdated
Comment thread docs/en/resources/tools/cloudgda/cloud-gda-query.md Outdated
Comment thread docs/en/resources/tools/cloudgda/cloud-gda-query.md Outdated
Comment thread docs/en/resources/tools/cloudgda/cloud-gda-query.md Outdated
Comment thread docs/en/resources/tools/cloudgda/cloud-gda-query.md
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@wangauone

Copy link
Copy Markdown
Contributor Author

What kind of E2E testing have we done on this tool?

The tests has been done on CloudSQL, Spanner, and AlloyDB with both ADC and Client-side OAuth via CURL like

❯ curl -X POST "http://localhost:5000/mcp" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "cloud_gda_query_tool_pg",
      "arguments": {
        "prompt": "Show me the top 5 customers by revenue"
      }
    }
  }'

Gemini CLI integration with the Toolbox is also done.

> Call cloud_gda_query_tool_pg tool with "Show me the top 5 customers by revenue"

│ ✓  cloud_gda_query_tool_pg (mcp-toolbox-local MCP Server) {"prompt":"Show me the top 5 customers by revenue"}                                                                                                                                                              
│ {"generatedQuery":"-- NOTE: Assuming \"revenue\" refers to the sum of transaction amounts in the 'trans' table.

@averikitsch averikitsch added the release candidate Use label to signal PR should be included in the next release. label Dec 16, 2025

@Yuan325 Yuan325 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let me know if you need more clarifications, thank you! :)

Comment thread internal/tools/cloudgda/cloudgda.go Outdated
Comment thread internal/tools/cloudgda/cloudgda.go Outdated
Comment thread internal/tools/cloudgda/cloudgda.go
Comment thread internal/tools/cloudgda/types.go
Comment thread tests/cloudgda/cloud_gda_integration_test.go
Comment thread tests/cloudgda/cloud_gda_integration_test.go Outdated
Comment thread tests/cloudgda/cloud_gda_integration_test.go
@wangauone wangauone requested a review from Yuan325 December 17, 2025 19:19
@wangauone

Copy link
Copy Markdown
Contributor Author

ase let me know if you need more clarifications, thank you! :)

Thanks Yuan. All updated. Please have another check.

@github-actions

Copy link
Copy Markdown
Contributor

Comment thread docs/en/resources/tools/cloudgda/cloud-gda-query.md Outdated
Comment thread docs/en/resources/tools/cloudgda/cloud-gda-query.md
@Yuan325 Yuan325 added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 17, 2025
Comment thread tests/cloudgda/cloud_gda_integration_test.go
Comment thread docs/en/resources/tools/cloudgda/cloud-gda-query.md Outdated
Comment thread docs/en/resources/tools/cloudgda/_index.md Outdated
@Yuan325 Yuan325 removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 18, 2025
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@wangauone wangauone merged commit aa270b2 into main Dec 18, 2025
12 checks passed
@wangauone wangauone deleted the gda-integration branch December 18, 2025 17:58
@github-actions

Copy link
Copy Markdown
Contributor

🧨 Preview deployments removed.

github-actions Bot pushed a commit that referenced this pull request Dec 18, 2025
…NL2SQL conversion to Toolbox (#2181)

## Description

This PR is to add the Gemini Data Analytics (GDA) integration for DB
NL2SQL conversion to Toolbox. It allows the user to convert a natural
language query to SQL statement based on their database instance. See
the doc section for details.

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #2180

---------

Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> aa270b2
github-actions Bot pushed a commit to renovate-bot/googleapis-_-genai-toolbox that referenced this pull request Dec 18, 2025
…NL2SQL conversion to Toolbox (googleapis#2181)

## Description

This PR is to add the Gemini Data Analytics (GDA) integration for DB
NL2SQL conversion to Toolbox. It allows the user to convert a natural
language query to SQL statement based on their database instance. See
the doc section for details.

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes googleapis#2180

---------

Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> aa270b2
Yuan325 added a commit that referenced this pull request Dec 19, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.24.0](v0.23.0...v0.24.0)
(2025-12-19)


### Features

* **sources/cloud-gemini-data-analytics:** Add the Gemini Data Analytics
(GDA) integration for DB NL2SQL conversion to Toolbox
([#2181](#2181))
([aa270b2](aa270b2))
* **source/cloudsqlmysql:** Add support for IAM authentication in Cloud
SQL MySQL source
([#2050](#2050))
([af3d3c5](af3d3c5))
* **sources/oracle:** Add Oracle OCI and Wallet support
([#1945](#1945))
([8ea39ec](8ea39ec))
* Support combining prebuilt and custom tool configurations
([#2188](#2188))
([5788605](5788605))
* **tools/mysql-get-query-plan:** Add new `mysql-get-query-plan` tool
for MySQL source
([#2123](#2123))
([0641da0](0641da0))


### Bug Fixes

* **spanner:** Move list graphs validation to runtime
([#2154](#2154))
([914b3ee](914b3ee))


---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
github-actions Bot pushed a commit that referenced this pull request Dec 19, 2025
🤖 I have created a release *beep* *boop*
---

##
[0.24.0](v0.23.0...v0.24.0)
(2025-12-19)

### Features

* **sources/cloud-gemini-data-analytics:** Add the Gemini Data Analytics
(GDA) integration for DB NL2SQL conversion to Toolbox
([#2181](#2181))
([aa270b2](aa270b2))
* **source/cloudsqlmysql:** Add support for IAM authentication in Cloud
SQL MySQL source
([#2050](#2050))
([af3d3c5](af3d3c5))
* **sources/oracle:** Add Oracle OCI and Wallet support
([#1945](#1945))
([8ea39ec](8ea39ec))
* Support combining prebuilt and custom tool configurations
([#2188](#2188))
([5788605](5788605))
* **tools/mysql-get-query-plan:** Add new `mysql-get-query-plan` tool
for MySQL source
([#2123](#2123))
([0641da0](0641da0))

### Bug Fixes

* **spanner:** Move list graphs validation to runtime
([#2154](#2154))
([914b3ee](914b3ee))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> f520b4e
github-actions Bot pushed a commit to renovate-bot/googleapis-_-genai-toolbox that referenced this pull request Dec 19, 2025
🤖 I have created a release *beep* *boop*
---

##
[0.24.0](googleapis/mcp-toolbox@v0.23.0...v0.24.0)
(2025-12-19)

### Features

* **sources/cloud-gemini-data-analytics:** Add the Gemini Data Analytics
(GDA) integration for DB NL2SQL conversion to Toolbox
([googleapis#2181](googleapis#2181))
([aa270b2](googleapis@aa270b2))
* **source/cloudsqlmysql:** Add support for IAM authentication in Cloud
SQL MySQL source
([googleapis#2050](googleapis#2050))
([af3d3c5](googleapis@af3d3c5))
* **sources/oracle:** Add Oracle OCI and Wallet support
([googleapis#1945](googleapis#1945))
([8ea39ec](googleapis@8ea39ec))
* Support combining prebuilt and custom tool configurations
([googleapis#2188](googleapis#2188))
([5788605](googleapis@5788605))
* **tools/mysql-get-query-plan:** Add new `mysql-get-query-plan` tool
for MySQL source
([googleapis#2123](googleapis#2123))
([0641da0](googleapis@0641da0))

### Bug Fixes

* **spanner:** Move list graphs validation to runtime
([googleapis#2154](googleapis#2154))
([914b3ee](googleapis@914b3ee))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> f520b4e
github-actions Bot pushed a commit to bhardwajRahul/genai-toolbox that referenced this pull request Dec 20, 2025
🤖 I have created a release *beep* *boop*
---

##
[0.24.0](googleapis/mcp-toolbox@v0.23.0...v0.24.0)
(2025-12-19)

### Features

* **sources/cloud-gemini-data-analytics:** Add the Gemini Data Analytics
(GDA) integration for DB NL2SQL conversion to Toolbox
([googleapis#2181](googleapis#2181))
([aa270b2](googleapis@aa270b2))
* **source/cloudsqlmysql:** Add support for IAM authentication in Cloud
SQL MySQL source
([googleapis#2050](googleapis#2050))
([af3d3c5](googleapis@af3d3c5))
* **sources/oracle:** Add Oracle OCI and Wallet support
([googleapis#1945](googleapis#1945))
([8ea39ec](googleapis@8ea39ec))
* Support combining prebuilt and custom tool configurations
([googleapis#2188](googleapis#2188))
([5788605](googleapis@5788605))
* **tools/mysql-get-query-plan:** Add new `mysql-get-query-plan` tool
for MySQL source
([googleapis#2123](googleapis#2123))
([0641da0](googleapis@0641da0))

### Bug Fixes

* **spanner:** Move list graphs validation to runtime
([googleapis#2154](googleapis#2154))
([914b3ee](googleapis@914b3ee))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> f520b4e
vinodhinic pushed a commit to vinodhinic/genai-toolbox that referenced this pull request Jan 14, 2026
…onversion to Toolbox (googleapis#2181)

## Description

This PR is to add the Gemini Data Analytics (GDA) integration for DB
NL2SQL conversion to Toolbox. It allows the user to convert a natural
language query to SQL statement based on their database instance. See
the doc section for details.

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes googleapis#2180

---------

Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
vinodhinic pushed a commit to vinodhinic/genai-toolbox that referenced this pull request Jan 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.24.0](googleapis/mcp-toolbox@v0.23.0...v0.24.0)
(2025-12-19)


### Features

* **sources/cloud-gemini-data-analytics:** Add the Gemini Data Analytics
(GDA) integration for DB NL2SQL conversion to Toolbox
([googleapis#2181](googleapis#2181))
([aa270b2](googleapis@aa270b2))
* **source/cloudsqlmysql:** Add support for IAM authentication in Cloud
SQL MySQL source
([googleapis#2050](googleapis#2050))
([af3d3c5](googleapis@af3d3c5))
* **sources/oracle:** Add Oracle OCI and Wallet support
([googleapis#1945](googleapis#1945))
([8ea39ec](googleapis@8ea39ec))
* Support combining prebuilt and custom tool configurations
([googleapis#2188](googleapis#2188))
([5788605](googleapis@5788605))
* **tools/mysql-get-query-plan:** Add new `mysql-get-query-plan` tool
for MySQL source
([googleapis#2123](googleapis#2123))
([0641da0](googleapis@0641da0))


### Bug Fixes

* **spanner:** Move list graphs validation to runtime
([googleapis#2154](googleapis#2154))
([914b3ee](googleapis@914b3ee))


---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
NightStack15 added a commit to NightStack15/googleapis-_-genai-toolbox that referenced this pull request Mar 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.24.0](googleapis/mcp-toolbox@v0.23.0...v0.24.0)
(2025-12-19)


### Features

* **sources/cloud-gemini-data-analytics:** Add the Gemini Data Analytics
(GDA) integration for DB NL2SQL conversion to Toolbox
([#2181](googleapis/mcp-toolbox#2181))
([aa270b2](googleapis/mcp-toolbox@aa270b2))
* **source/cloudsqlmysql:** Add support for IAM authentication in Cloud
SQL MySQL source
([#2050](googleapis/mcp-toolbox#2050))
([af3d3c5](googleapis/mcp-toolbox@af3d3c5))
* **sources/oracle:** Add Oracle OCI and Wallet support
([#1945](googleapis/mcp-toolbox#1945))
([8ea39ec](googleapis/mcp-toolbox@8ea39ec))
* Support combining prebuilt and custom tool configurations
([#2188](googleapis/mcp-toolbox#2188))
([5788605](googleapis/mcp-toolbox@5788605))
* **tools/mysql-get-query-plan:** Add new `mysql-get-query-plan` tool
for MySQL source
([#2123](googleapis/mcp-toolbox#2123))
([0641da0](googleapis/mcp-toolbox@0641da0))


### Bug Fixes

* **spanner:** Move list graphs validation to runtime
([#2154](googleapis/mcp-toolbox#2154))
([914b3ee](googleapis/mcp-toolbox@914b3ee))


---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release candidate Use label to signal PR should be included in the next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Gemini Data Analytics (GDA) API integration

5 participants