Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mysql): fix mysql tool kind to mysql-sql #248

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
spannersrc "github.com/googleapis/genai-toolbox/internal/sources/spanner"
"github.com/googleapis/genai-toolbox/internal/tools"
"github.com/googleapis/genai-toolbox/internal/tools/mssql"
"github.com/googleapis/genai-toolbox/internal/tools/mysql"
"github.com/googleapis/genai-toolbox/internal/tools/mysqlsql"
neo4jtool "github.com/googleapis/genai-toolbox/internal/tools/neo4j"
"github.com/googleapis/genai-toolbox/internal/tools/postgressql"
"github.com/googleapis/genai-toolbox/internal/tools/spanner"
Expand Down Expand Up @@ -254,8 +254,8 @@ func (c *ToolConfigs) UnmarshalYAML(unmarshal func(interface{}) error) error {
return fmt.Errorf("unable to parse as %q: %w", k.Kind, err)
}
(*c)[name] = actual
case mysql.ToolKind:
actual := mysql.Config{Name: name}
case mysqlsql.ToolKind:
actual := mysqlsql.Config{Name: name}
if err := u.Unmarshal(&actual); err != nil {
return fmt.Errorf("unable to parse as %q: %w", k.Kind, err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package mysql
package mysqlsql

import (
"context"
Expand All @@ -25,7 +25,7 @@ import (
"github.com/googleapis/genai-toolbox/internal/tools"
)

const ToolKind string = "mysql"
const ToolKind string = "mysql-sql"

type compatibleSource interface {
MySQLPool() *sql.DB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package mysql_test
package mysqlsql_test

import (
"testing"
Expand All @@ -21,7 +21,7 @@ import (
"github.com/googleapis/genai-toolbox/internal/server"
"github.com/googleapis/genai-toolbox/internal/testutils"
"github.com/googleapis/genai-toolbox/internal/tools"
"github.com/googleapis/genai-toolbox/internal/tools/mysql"
"github.com/googleapis/genai-toolbox/internal/tools/mysqlsql"
"gopkg.in/yaml.v3"
)

Expand All @@ -36,7 +36,7 @@ func TestParseFromYamlMySQL(t *testing.T) {
in: `
tools:
example_tool:
kind: mysql
kind: mysql-sql
source: my-mysql-instance
description: some description
statement: |
Expand All @@ -55,9 +55,9 @@ func TestParseFromYamlMySQL(t *testing.T) {
field: user_id
`,
want: server.ToolConfigs{
"example_tool": mysql.Config{
"example_tool": mysqlsql.Config{
Name: "example_tool",
Kind: mysql.ToolKind,
Kind: mysqlsql.ToolKind,
Source: "my-mysql-instance",
Description: "some description",
Statement: "SELECT * FROM SQL_STATEMENT;\n",
Expand Down
Loading