Skip to content

feat: support tidb in data source, sql tool, and execute sql tool#829

Merged
Yuan325 merged 19 commits intogoogleapis:mainfrom
Icemap:feat-tidb-support
Aug 2, 2025
Merged

feat: support tidb in data source, sql tool, and execute sql tool#829
Yuan325 merged 19 commits intogoogleapis:mainfrom
Icemap:feat-tidb-support

Conversation

@Icemap
Copy link
Contributor

@Icemap Icemap commented Jul 9, 2025

This PR supports TiDB in:

  1. sources - tidb: As a data source;
  2. tools - tidb - tidbsql: As a prepared SQL running tool;
  3. tools - tidb - tidbexecutesql: As an arbitrary SQL running tool (for development purposes).

And its corresponding docs.

@Icemap Icemap requested a review from a team July 9, 2025 14:27
@google-cla
Copy link

google-cla bot commented Jul 9, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Icemap
Copy link
Contributor Author

Icemap commented Jul 9, 2025

CLA was signed now. How can I make the CLA checking bot recheck the status?

@kurtisvg
Copy link
Collaborator

kurtisvg commented Jul 9, 2025

@Icemap there's a little button in the check details that says "click here to update CLA check". I've triggered it for this PR and looks like it's green

@Icemap
Copy link
Contributor Author

Icemap commented Jul 10, 2025

Thanks @kurtisvg, if you find any issues or have some suggestions during the code review, please let me know. I'll fix it ASAP.

@kurtisvg kurtisvg assigned duwenxin99 and unassigned Yuan325 Jul 10, 2025
@kurtisvg
Copy link
Collaborator

Thanks @Icemap! We've had a lot of interest in the repo over the last two days, which is making us run behind. Please give us a few days and we'll get back to you!

@duwenxin99
Copy link
Contributor

/gcbrun

@Yuan325 Yuan325 assigned Yuan325 and unassigned duwenxin99 Jul 22, 2025
@Yuan325 Yuan325 added docs: deploy-preview Label to trigger Github Action docs preview. tests: run Label to trigger Github Action tests. labels Jul 28, 2025
@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Jul 28, 2025
@github-actions
Copy link
Contributor

Copy link
Contributor

@Yuan325 Yuan325 left a comment

Choose a reason for hiding this comment

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

Hi @Icemap ! Sorry for the late response. I left some comments on this PR. While you make the changes, I'll also start setting up TiDB vm in our integration test.

Please let me know if you require more clarification on any of the feedbacks! :) Thank you again for contributing!!

@c4pt0r
Copy link

c4pt0r commented Jul 29, 2025

Thanks @Icemap! We've had a lot of interest in the repo over the last two days, which is making us run behind. Please give us a few days and we'll get back to you!

any updates on this? really appreciate it

@Icemap
Copy link
Contributor Author

Icemap commented Jul 29, 2025

Great, @Yuan325. Thanks for the feedback. I'll apply those suggestions ASAP.

@Icemap
Copy link
Contributor Author

Icemap commented Jul 29, 2025

Hi @Yuan325 . I've applied all your suggestions. You are such a great reviewer! Thanks for your collaboration. If I missed something, please feel free to leave more suggestions. Great work!

@Yuan325 Yuan325 added the tests: run Label to trigger Github Action tests. label Aug 2, 2025
@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Aug 2, 2025
@Icemap
Copy link
Contributor Author

Icemap commented Aug 2, 2025

That's cool! @Yuan325 It's a great move, and I'll add more features to enrich these tools later.

@Yuan325 Yuan325 enabled auto-merge (squash) August 2, 2025 07:52
@Yuan325 Yuan325 disabled auto-merge August 2, 2025 07:54
@Yuan325 Yuan325 merged commit 6eaf36a into googleapis:main Aug 2, 2025
12 checks passed
github-actions bot pushed a commit that referenced this pull request Aug 2, 2025
…tool (#829)

This PR supports TiDB in:

1. sources - tidb: As a data source;
2. tools - tidb - tidbsql: As a prepared SQL running tool;
3. tools - tidb - tidbexecutesql: As an arbitrary SQL running tool (for
development purposes).

And its corresponding docs.

---------

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


##
[0.11.0](v0.10.0...v0.11.0)
(2025-08-04)


### ⚠ BREAKING CHANGES

* **tools/bigquery-sql:** Ensure invoke always returns a non-null value
([#1020](#1020))
([9af55b6](9af55b6))
* **tools/bigquery-execute-sql:** Update the return messages
([#1034](#1034))
([051e686](051e686))

### Features

* Add DuckDB source and tool
([#879](#879))
([fd14933](fd14933))
* Add TiDB source and tool
([#829](#829))
([6eaf36a](6eaf36a))
* Interactive web UI for Toolbox
([#1065](#1065))
([8749b03](8749b03))
* **tools/looker-query-url:** Add support for `looker-query-url` tool
([#1015](#1015))
([327ddf0](327ddf0))
* **tools/dataplex-lookup-entry:** Add support for
`dataplex-lookup-entry` tool
([#1009](#1009))
([5fa1660](5fa1660))

---
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 Aug 5, 2025
🤖 I have created a release *beep* *boop*
---

##
[0.11.0](v0.10.0...v0.11.0)
(2025-08-04)

### ⚠ BREAKING CHANGES

* **tools/bigquery-sql:** Ensure invoke always returns a non-null value
([#1020](#1020))
([9af55b6](9af55b6))
* **tools/bigquery-execute-sql:** Update the return messages
([#1034](#1034))
([051e686](051e686))

### Features

* Add DuckDB source and tool
([#879](#879))
([fd14933](fd14933))
* Add TiDB source and tool
([#829](#829))
([6eaf36a](6eaf36a))
* Interactive web UI for Toolbox
([#1065](#1065))
([8749b03](8749b03))
* **tools/looker-query-url:** Add support for `looker-query-url` tool
([#1015](#1015))
([327ddf0](327ddf0))
* **tools/dataplex-lookup-entry:** Add support for
`dataplex-lookup-entry` tool
([#1009](#1009))
([5fa1660](5fa1660))

---
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> 8d0fa67
github-actions bot pushed a commit to renovate-bot/googleapis-_-genai-toolbox that referenced this pull request Aug 5, 2025
🤖 I have created a release *beep* *boop*
---

##
[0.11.0](googleapis/genai-toolbox@v0.10.0...v0.11.0)
(2025-08-04)

### ⚠ BREAKING CHANGES

* **tools/bigquery-sql:** Ensure invoke always returns a non-null value
([googleapis#1020](googleapis#1020))
([9af55b6](googleapis@9af55b6))
* **tools/bigquery-execute-sql:** Update the return messages
([googleapis#1034](googleapis#1034))
([051e686](googleapis@051e686))

### Features

* Add DuckDB source and tool
([googleapis#879](googleapis#879))
([fd14933](googleapis@fd14933))
* Add TiDB source and tool
([googleapis#829](googleapis#829))
([6eaf36a](googleapis@6eaf36a))
* Interactive web UI for Toolbox
([googleapis#1065](googleapis#1065))
([8749b03](googleapis@8749b03))
* **tools/looker-query-url:** Add support for `looker-query-url` tool
([googleapis#1015](googleapis#1015))
([327ddf0](googleapis@327ddf0))
* **tools/dataplex-lookup-entry:** Add support for
`dataplex-lookup-entry` tool
([googleapis#1009](googleapis#1009))
([5fa1660](googleapis@5fa1660))

---
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> 8d0fa67
github-actions bot pushed a commit to bpranava/genai-toolbox that referenced this pull request Aug 5, 2025
🤖 I have created a release *beep* *boop*
---

##
[0.11.0](googleapis/genai-toolbox@v0.10.0...v0.11.0)
(2025-08-04)

### ⚠ BREAKING CHANGES

* **tools/bigquery-sql:** Ensure invoke always returns a non-null value
([googleapis#1020](googleapis#1020))
([9af55b6](googleapis@9af55b6))
* **tools/bigquery-execute-sql:** Update the return messages
([googleapis#1034](googleapis#1034))
([051e686](googleapis@051e686))

### Features

* Add DuckDB source and tool
([googleapis#879](googleapis#879))
([fd14933](googleapis@fd14933))
* Add TiDB source and tool
([googleapis#829](googleapis#829))
([6eaf36a](googleapis@6eaf36a))
* Interactive web UI for Toolbox
([googleapis#1065](googleapis#1065))
([8749b03](googleapis@8749b03))
* **tools/looker-query-url:** Add support for `looker-query-url` tool
([googleapis#1015](googleapis#1015))
([327ddf0](googleapis@327ddf0))
* **tools/dataplex-lookup-entry:** Add support for
`dataplex-lookup-entry` tool
([googleapis#1009](googleapis#1009))
([5fa1660](googleapis@5fa1660))

---
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> 8d0fa67
github-actions bot pushed a commit to bhardwajRahul/genai-toolbox that referenced this pull request Aug 5, 2025
🤖 I have created a release *beep* *boop*
---

##
[0.11.0](googleapis/genai-toolbox@v0.10.0...v0.11.0)
(2025-08-04)

### ⚠ BREAKING CHANGES

* **tools/bigquery-sql:** Ensure invoke always returns a non-null value
([googleapis#1020](googleapis#1020))
([9af55b6](googleapis@9af55b6))
* **tools/bigquery-execute-sql:** Update the return messages
([googleapis#1034](googleapis#1034))
([051e686](googleapis@051e686))

### Features

* Add DuckDB source and tool
([googleapis#879](googleapis#879))
([fd14933](googleapis@fd14933))
* Add TiDB source and tool
([googleapis#829](googleapis#829))
([6eaf36a](googleapis@6eaf36a))
* Interactive web UI for Toolbox
([googleapis#1065](googleapis#1065))
([8749b03](googleapis@8749b03))
* **tools/looker-query-url:** Add support for `looker-query-url` tool
([googleapis#1015](googleapis#1015))
([327ddf0](googleapis@327ddf0))
* **tools/dataplex-lookup-entry:** Add support for
`dataplex-lookup-entry` tool
([googleapis#1009](googleapis#1009))
([5fa1660](googleapis@5fa1660))

---
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> 8d0fa67
Yuan325 added a commit that referenced this pull request Aug 5, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.11.0](v0.11.0...v0.11.0)
(2025-08-05)


### ⚠ BREAKING CHANGES

* **tools/bigquery-sql:** Ensure invoke always returns a non-null value
([#1020](#1020))
([9af55b6](9af55b6))
* **tools/bigquery-execute-sql:** Update the return messages
([#1034](#1034))
([051e686](051e686))

### Features

* Add TiDB source and tool
([#829](#829))
([6eaf36a](6eaf36a))
* Interactive web UI for Toolbox
([#1065](#1065))
([8749b03](8749b03))
* **prebuiltconfigs/cloud-sql-postgres:** Introduce additional parameter
to limit context in list tables
([#1062](#1062))
([c3a58e1](c3a58e1))
* **tools/looker-query-url:** Add support for `looker-query-url` tool
([#1015](#1015))
([327ddf0](327ddf0))
* **tools/dataplex-lookup-entry:** Add support for
`dataplex-lookup-entry` tool
([#1009](#1009))
([5fa1660](5fa1660))

### Bug Fixes

* **tools/bigquery,mssql,mysql,postgres,spanner,tidb:** Add query
logging to execute-sql tools
([#1069](#1069))
([0527532]([0527532))

---
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 Aug 5, 2025
🤖 I have created a release *beep* *boop*
---

##
[0.11.0](v0.11.0...v0.11.0)
(2025-08-05)

### ⚠ BREAKING CHANGES

* **tools/bigquery-sql:** Ensure invoke always returns a non-null value
([#1020](#1020))
([9af55b6](9af55b6))
* **tools/bigquery-execute-sql:** Update the return messages
([#1034](#1034))
([051e686](051e686))

### Features

* Add TiDB source and tool
([#829](#829))
([6eaf36a](6eaf36a))
* Interactive web UI for Toolbox
([#1065](#1065))
([8749b03](8749b03))
* **prebuiltconfigs/cloud-sql-postgres:** Introduce additional parameter
to limit context in list tables
([#1062](#1062))
([c3a58e1](c3a58e1))
* **tools/looker-query-url:** Add support for `looker-query-url` tool
([#1015](#1015))
([327ddf0](327ddf0))
* **tools/dataplex-lookup-entry:** Add support for
`dataplex-lookup-entry` tool
([#1009](#1009))
([5fa1660](5fa1660))

### Bug Fixes

* **tools/bigquery,mssql,mysql,postgres,spanner,tidb:** Add query
logging to execute-sql tools
([#1069](#1069))
([0527532]([0527532))

---
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> a09f628
github-actions bot pushed a commit to renovate-bot/googleapis-_-genai-toolbox that referenced this pull request Aug 5, 2025
🤖 I have created a release *beep* *boop*
---

##
[0.11.0](googleapis/genai-toolbox@v0.11.0...v0.11.0)
(2025-08-05)

### ⚠ BREAKING CHANGES

* **tools/bigquery-sql:** Ensure invoke always returns a non-null value
([googleapis#1020](googleapis#1020))
([9af55b6](googleapis@9af55b6))
* **tools/bigquery-execute-sql:** Update the return messages
([googleapis#1034](googleapis#1034))
([051e686](googleapis@051e686))

### Features

* Add TiDB source and tool
([googleapis#829](googleapis#829))
([6eaf36a](googleapis@6eaf36a))
* Interactive web UI for Toolbox
([googleapis#1065](googleapis#1065))
([8749b03](googleapis@8749b03))
* **prebuiltconfigs/cloud-sql-postgres:** Introduce additional parameter
to limit context in list tables
([googleapis#1062](googleapis#1062))
([c3a58e1](googleapis@c3a58e1))
* **tools/looker-query-url:** Add support for `looker-query-url` tool
([googleapis#1015](googleapis#1015))
([327ddf0](googleapis@327ddf0))
* **tools/dataplex-lookup-entry:** Add support for
`dataplex-lookup-entry` tool
([googleapis#1009](googleapis#1009))
([5fa1660](googleapis@5fa1660))

### Bug Fixes

* **tools/bigquery,mssql,mysql,postgres,spanner,tidb:** Add query
logging to execute-sql tools
([googleapis#1069](googleapis#1069))
([0527532]([googleapis@0527532))

---
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> a09f628
SaxenaAnushka102 pushed a commit to SaxenaAnushka102/genai-toolbox that referenced this pull request Aug 14, 2025
…ogleapis#829)

This PR supports TiDB in:

1. sources - tidb: As a data source;
2. tools - tidb - tidbsql: As a prepared SQL running tool;
3. tools - tidb - tidbexecutesql: As an arbitrary SQL running tool (for
development purposes).

And its corresponding docs.

---------

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


##
[0.11.0](googleapis/genai-toolbox@v0.10.0...v0.11.0)
(2025-08-04)


### ⚠ BREAKING CHANGES

* **tools/bigquery-sql:** Ensure invoke always returns a non-null value
([googleapis#1020](googleapis#1020))
([9af55b6](googleapis@9af55b6))
* **tools/bigquery-execute-sql:** Update the return messages
([googleapis#1034](googleapis#1034))
([051e686](googleapis@051e686))

### Features

* Add DuckDB source and tool
([googleapis#879](googleapis#879))
([fd14933](googleapis@fd14933))
* Add TiDB source and tool
([googleapis#829](googleapis#829))
([6eaf36a](googleapis@6eaf36a))
* Interactive web UI for Toolbox
([googleapis#1065](googleapis#1065))
([8749b03](googleapis@8749b03))
* **tools/looker-query-url:** Add support for `looker-query-url` tool
([googleapis#1015](googleapis#1015))
([327ddf0](googleapis@327ddf0))
* **tools/dataplex-lookup-entry:** Add support for
`dataplex-lookup-entry` tool
([googleapis#1009](googleapis#1009))
([5fa1660](googleapis@5fa1660))

---
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>
SaxenaAnushka102 pushed a commit to SaxenaAnushka102/genai-toolbox that referenced this pull request Aug 14, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.11.0](googleapis/genai-toolbox@v0.11.0...v0.11.0)
(2025-08-05)


### ⚠ BREAKING CHANGES

* **tools/bigquery-sql:** Ensure invoke always returns a non-null value
([googleapis#1020](googleapis#1020))
([9af55b6](googleapis@9af55b6))
* **tools/bigquery-execute-sql:** Update the return messages
([googleapis#1034](googleapis#1034))
([051e686](googleapis@051e686))

### Features

* Add TiDB source and tool
([googleapis#829](googleapis#829))
([6eaf36a](googleapis@6eaf36a))
* Interactive web UI for Toolbox
([googleapis#1065](googleapis#1065))
([8749b03](googleapis@8749b03))
* **prebuiltconfigs/cloud-sql-postgres:** Introduce additional parameter
to limit context in list tables
([googleapis#1062](googleapis#1062))
([c3a58e1](googleapis@c3a58e1))
* **tools/looker-query-url:** Add support for `looker-query-url` tool
([googleapis#1015](googleapis#1015))
([327ddf0](googleapis@327ddf0))
* **tools/dataplex-lookup-entry:** Add support for
`dataplex-lookup-entry` tool
([googleapis#1009](googleapis#1009))
([5fa1660](googleapis@5fa1660))

### Bug Fixes

* **tools/bigquery,mssql,mysql,postgres,spanner,tidb:** Add query
logging to execute-sql tools
([googleapis#1069](googleapis#1069))
([0527532]([googleapis@0527532))

---
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>
@Yuan325
Copy link
Contributor

Yuan325 commented Sep 17, 2025

@Icemap Hi! We found that the TiDB's log has been taking a big space from the VM and often hit disk full state.

I've tried to add the following config in my topo.yaml:

server_configs:
  tidb:
    log.file.max-days: 1
    log.file.max-backups: 1

monitoring_servers:
  - host: 10.128.0.2
    storage_retention: 1d

However, my ~/data/tidb-deploy/prometheus-9090/data/tidb-data still consist of datas generated from 6 days ago. I'm wondering if that's not the right configuration to set prometheus storage retention?

Thank you!

@Icemap
Copy link
Contributor Author

Icemap commented Sep 17, 2025

Got it. Let me loop in our o11y engineers in this PR.

@Icemap
Copy link
Contributor Author

Icemap commented Sep 17, 2025

Here is a solution that you can use to delete the extra data immediately, which is restarting Prometheus with an extra parameter. @Yuan325 https://ask.pingcap.com/t/how-to-adjust-the-data-retention-period-for-monitoring-servers/9439
And then, we can check why the TiUP's config didn't sync up to Prometheus.

@Yuan325
Copy link
Contributor

Yuan325 commented Sep 23, 2025

@Icemap Got it. Yeah, when I check ps -ef|grep prometheus, it shows --storage.tsdb.retention=30d, which is different from what I set in topo.yaml (2d).

My prometheus service only start with tiup, how do I restarting just that with the extra parameter (tiup cluster restart <cluster-name> -R prometheus won't allow to add prometheus specific flags)? I'm assuming we should not be restarting prometheus with the systemctl. If you have the command line that'll be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: deploy-preview Label to trigger Github Action docs preview.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants