## Description Tool mysql-get-query-plan implementation, along with tests and docs. Tool used to get information about how MySQL executes a SQL statement (EXPLAIN). ## PR Checklist - [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 #1692 --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Averi Kitsch <akitsch@google.com> Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
3.5 KiB
title, type, weight, description
| title | type | weight | description |
|---|---|---|---|
| MySQL | docs | 1 | MySQL is a relational database management system that stores and manages data. |
About
MySQL is a relational database management system (RDBMS) that stores and manages data. It's a popular choice for developers because of its reliability, performance, and ease of use.
Available Tools
-
mysql-sqlExecute pre-defined prepared SQL queries in MySQL. -
mysql-execute-sqlRun parameterized SQL queries in MySQL. -
mysql-list-active-queriesList active queries in MySQL. -
mysql-get-query-planProvide information about how MySQL executes a SQL statement (EXPLAIN). -
mysql-list-tablesList tables in a MySQL database. -
mysql-list-tables-missing-unique-indexesList tables in a MySQL database that do not have primary or unique indices. -
mysql-list-table-fragmentationList table fragmentation in MySQL tables.
Requirements
Database User
This source only uses standard authentication. You will need to create a MySQL user to login to the database with.
Example
sources:
my-mysql-source:
kind: mysql
host: 127.0.0.1
port: 3306
database: my_db
user: ${USER_NAME}
password: ${PASSWORD}
# Optional TLS and other driver parameters. For example, enable preferred TLS:
# queryParams:
# tls: preferred
queryTimeout: 30s # Optional: query timeout duration
{{< notice tip >}} Use environment variable replacement with the format ${ENV_NAME} instead of hardcoding your secrets into the configuration file. {{< /notice >}}
Reference
| field | type | required | description |
|---|---|---|---|
| kind | string | true | Must be "mysql". |
| host | string | true | IP address to connect to (e.g. "127.0.0.1"). |
| port | string | true | Port to connect to (e.g. "3306"). |
| database | string | true | Name of the MySQL database to connect to (e.g. "my_db"). |
| user | string | true | Name of the MySQL user to connect as (e.g. "my-mysql-user"). |
| password | string | true | Password of the MySQL user (e.g. "my-password"). |
| queryTimeout | string | false | Maximum time to wait for query execution (e.g. "30s", "2m"). By default, no timeout is applied. |
| queryParams | map<string,string> | false | Arbitrary DSN parameters passed to the driver (e.g. tls: preferred, charset: utf8mb4). Useful for enabling TLS or other connection options. |