-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(trino): Add Trino source and tools #948
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
Conversation
Add support for Trino distributed SQL query engine with complete implementation including sources, tools, documentation, and tests. ## Summary - Add Trino source implementation with multiple authentication methods - Create trino-execute-sql tool for arbitrary SQL execution - Create trino-sql tool for parameterized queries - Add comprehensive documentation and prebuilt configurations - Include unit tests for all components ## Features ### Authentication Support - Basic authentication (username/password) - JWT token authentication - Kerberos authentication - SSL/TLS connections ### Tools - **trino-execute-sql**: Execute arbitrary SQL queries - **trino-sql**: Execute parameterized SQL with prepared statements - Prebuilt tools for common operations (list catalogs, schemas, tables, etc.) ### Cross-Catalog Queries - Support for federated queries across multiple data sources - Query Hive, PostgreSQL, MySQL, and other connectors in single queries - Leverage Trino's distributed query engine capabilities ## Test Plan - [x] Unit tests pass for source DSN generation - [x] Unit tests pass for tool parameter validation - [x] Project builds successfully with new dependencies - [x] Documentation includes comprehensive examples
|
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. |
|
Hi @abhinavm24, just wanted to say thanks for the PR, and let you know we are a little behind on reviewing new sources/tools right now. We've had a lot of submissions recently which has given us a lot to do. Please be patient with us! |
Yuan325
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @abhinavm24, thanks for opening this PR! :) I've left feedbacks for this PR, please update them and re-request review once this is ready, also feel free to update the status from "Draft" to "Ready to review".
Please also add the integration test for Trino within this PR as well. I'll set up the database for integration tests once this is added. Ref: https://github.com/googleapis/genai-toolbox/blob/main/tests/mysql/mysql_integration_test.go
|
Hey @Yuan325 Thanks for the review |
- Update interface method: Database() -> TrinoDB() following MySQL pattern - Fix struct fields: Pool -> Db for consistency - Update test packages to _test pattern with proper YAML parsing tests - Fix documentation formatting to match PostgreSQL tools format - Add template parameter support to trino-sql tool - Remove prebuilt configs (moved to separate PR) - Fix DSN building function with proper URL construction - Remove generic Database() method, keep only TrinoDB() All tests pass and project builds successfully. Addresses Yuan325's review feedback completely.
- Add comprehensive integration test for Trino following MySQL pattern - Include test helper functions in tests/common.go: - GetTrinoParamToolInfo() for parameter testing - GetTrinoAuthToolInfo() for authentication testing - GetTrinoTmplToolStatement() for template parameters - SetupTrinoTable() for table setup/teardown - AddTrinoExecuteSqlConfig() for execute-sql tool config - GetTrinoWants() for expected test results - Integration test covers all standard scenarios: - Basic tool invocation - Parameter handling (standard and template) - Authentication-required tools - Execute SQL functionality - MCP method calls - Test ready for database setup and execution
Addressed |
- Register Trino source and tools in cmd/root.go imports - Add missing Trino SQL driver import to integration test - Fixes 'unknown source kind: trino' and 'unknown driver: trino' errors - Enables Trino integration testing functionality
|
/gcbrun |
9abd6c4 to
c787b0b
Compare
c787b0b to
b3b76d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @abhinavm24, I've left a couple more feedbacks in the code and added the integration test for Trino.
Seems like we are getting the following error: unable to insert test data: trino: query failed (200 OK): "USER_ERROR: This connector does not support inserts". I used a faker connector for testing. Does a fake connector not work for inserts? Do you have recommendation on which connector to use (the simpler the better)?
Thank you again for your contribution :)
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
|
@Yuan325 The generated tables by faker are readonly. We can use https://trino.io/docs/current/connector/memory.html instead |
48563a2 to
77e9139
Compare
77e9139 to
635a801
Compare
|
Hi @abhinavm24 Quick update, memorystore worked and I'm able to get the integration tests run successfully! I'll go ahead and merge this branch. Thank you again for your contribution on MCP Toolbox!! 🙏 |
|
/gcbrun |
|
/gcbrun |
Add support for Trino distributed SQL query engine with complete implementation including sources, tools, documentation, and tests. ## Summary - Add Trino source implementation with multiple authentication methods - Create trino-execute-sql tool for arbitrary SQL execution - Create trino-sql tool for parameterized queries - Add comprehensive documentation ~~and prebuilt configurations~~ - Include unit tests for all components ## Features ### Authentication Support - Basic authentication (username/password) - JWT token authentication - Kerberos authentication - SSL/TLS connections ### Tools - **trino-execute-sql**: Execute arbitrary SQL queries - **trino-sql**: Execute parameterized SQL with prepared statements - Prebuilt tools for common operations (list catalogs, schemas, tables, etc.) ### Cross-Catalog Queries - Support for federated queries across multiple data sources - Query Hive, PostgreSQL, MySQL, and other connectors in single queries - Leverage Trino's distributed query engine capabilities ## Test Plan - [x] Unit tests pass for source DSN generation - [x] Unit tests pass for tool parameter validation - [x] Project builds successfully with new dependencies - [x] Documentation includes comprehensive examples Ref #880 --------- Co-authored-by: Yuan Teoh <yuanteoh@google.com> Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> 7dd123b
Add support for Trino distributed SQL query engine with complete implementation including sources, tools, documentation, and tests. ## Summary - Add Trino source implementation with multiple authentication methods - Create trino-execute-sql tool for arbitrary SQL execution - Create trino-sql tool for parameterized queries - Add comprehensive documentation ~~and prebuilt configurations~~ - Include unit tests for all components ## Features ### Authentication Support - Basic authentication (username/password) - JWT token authentication - Kerberos authentication - SSL/TLS connections ### Tools - **trino-execute-sql**: Execute arbitrary SQL queries - **trino-sql**: Execute parameterized SQL with prepared statements - Prebuilt tools for common operations (list catalogs, schemas, tables, etc.) ### Cross-Catalog Queries - Support for federated queries across multiple data sources - Query Hive, PostgreSQL, MySQL, and other connectors in single queries - Leverage Trino's distributed query engine capabilities ## Test Plan - [x] Unit tests pass for source DSN generation - [x] Unit tests pass for tool parameter validation - [x] Project builds successfully with new dependencies - [x] Documentation includes comprehensive examples Ref googleapis#880 --------- Co-authored-by: Yuan Teoh <yuanteoh@google.com> Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> 7dd123b
Add support for Trino distributed SQL query engine with complete implementation including sources, tools, documentation, and tests. ## Summary - Add Trino source implementation with multiple authentication methods - Create trino-execute-sql tool for arbitrary SQL execution - Create trino-sql tool for parameterized queries - Add comprehensive documentation ~~and prebuilt configurations~~ - Include unit tests for all components ## Features ### Authentication Support - Basic authentication (username/password) - JWT token authentication - Kerberos authentication - SSL/TLS connections ### Tools - **trino-execute-sql**: Execute arbitrary SQL queries - **trino-sql**: Execute parameterized SQL with prepared statements - Prebuilt tools for common operations (list catalogs, schemas, tables, etc.) ### Cross-Catalog Queries - Support for federated queries across multiple data sources - Query Hive, PostgreSQL, MySQL, and other connectors in single queries - Leverage Trino's distributed query engine capabilities ## Test Plan - [x] Unit tests pass for source DSN generation - [x] Unit tests pass for tool parameter validation - [x] Project builds successfully with new dependencies - [x] Documentation includes comprehensive examples Ref googleapis#880 --------- Co-authored-by: Yuan Teoh <yuanteoh@google.com> Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> 7dd123b
Add support for Trino distributed SQL query engine with complete implementation including sources, tools, documentation, and tests. ## Summary - Add Trino source implementation with multiple authentication methods - Create trino-execute-sql tool for arbitrary SQL execution - Create trino-sql tool for parameterized queries - Add comprehensive documentation ~~and prebuilt configurations~~ - Include unit tests for all components ## Features ### Authentication Support - Basic authentication (username/password) - JWT token authentication - Kerberos authentication - SSL/TLS connections ### Tools - **trino-execute-sql**: Execute arbitrary SQL queries - **trino-sql**: Execute parameterized SQL with prepared statements - Prebuilt tools for common operations (list catalogs, schemas, tables, etc.) ### Cross-Catalog Queries - Support for federated queries across multiple data sources - Query Hive, PostgreSQL, MySQL, and other connectors in single queries - Leverage Trino's distributed query engine capabilities ## Test Plan - [x] Unit tests pass for source DSN generation - [x] Unit tests pass for tool parameter validation - [x] Project builds successfully with new dependencies - [x] Documentation includes comprehensive examples Ref googleapis#880 --------- Co-authored-by: Yuan Teoh <yuanteoh@google.com> Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> 7dd123b
🤖 I have created a release *beep* *boop* --- ## [0.13.0](v0.12.0...v0.13.0) (2025-08-27) ### ⚠ BREAKING CHANGES * **prebuilt/alloydb:** Add bearer token support for alloydb-wait-for-operation ([#1183](#1183)) ### Features * Add capability to set default for environment variable in config ([#1248](#1248)) ([5bcd52e](5bcd52e)) * **firebird:** Add Firebird SQL 2.5+ source and tool ([#1011](#1011)) ([4f6b806](4f6b806)) * **oceanbase:** Add Oceanbase source and tool ([#895](#895)) ([6fc4982](6fc4982)) * **server/mcp:** Support `ping` mechanism ([#1178](#1178)) ([5dcc66c](5dcc66c)) * **server:** Fail-fast on environment variable substitution ([#1177](#1177)) ([212aaba](212aaba)) * **server:** Implement Tool call auth error propagation ([#1235](#1235)) ([b94a021](b94a021)) * **sources/bigquery:** Add support for user-credential passthrough ([#1067](#1067)) ([650e2e2](650e2e2)) * **tool/looker:** Add support for `description` field in looker tool ([#1199](#1199)) ([97f0dd2](97f0dd2)) * **tools/bigquery-ask-data-insights:** Add bigquery `ask-data-insights` tool ([#932](#932)) ([7651357](7651357)) * **tools/bigquery-forecast:** Add bigqueryforecast tool ([#1148](#1148)) ([2ad0ccf](2ad0ccf)) * **tools/firestore-add-documents:** Add firestore-add-documents tool ([#1107](#1107)) ([ee4a70a](ee4a70a)) * **tools/firestore-update-document:** Add firestore-update-document tool ([#1191](#1191)) ([0010123](0010123)) * **tools/looker:** Control over whether hidden objects are surfaced ([#1222](#1222)) ([bc91559](bc91559)) * **trino:** Add Trino source and tools ([#948](#948)) ([7dd123b](7dd123b)) ### Bug Fixes * **tools/looker:** Lookergetdashboards uses proper Authorized helper func ([#1255](#1255)) ([00866bc](00866bc)) * **tools/mongodb-find-one:** ProjectPayload unmarshaling ([#1167](#1167)) ([8ea6a98](8ea6a98)) * **tools/mysql:** Fix encoded text for mysql ([#1161](#1161)) ([a37cfa8](a37cfa8)), closes [#840](#840) --- 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>
🤖 I have created a release *beep* *boop* --- ## [0.13.0](v0.12.0...v0.13.0) (2025-08-27) ### ⚠ BREAKING CHANGES * **prebuilt/alloydb:** Add bearer token support for alloydb-wait-for-operation ([#1183](#1183)) ### Features * Add capability to set default for environment variable in config ([#1248](#1248)) ([5bcd52e](5bcd52e)) * **firebird:** Add Firebird SQL 2.5+ source and tool ([#1011](#1011)) ([4f6b806](4f6b806)) * **oceanbase:** Add Oceanbase source and tool ([#895](#895)) ([6fc4982](6fc4982)) * **server/mcp:** Support `ping` mechanism ([#1178](#1178)) ([5dcc66c](5dcc66c)) * **server:** Fail-fast on environment variable substitution ([#1177](#1177)) ([212aaba](212aaba)) * **server:** Implement Tool call auth error propagation ([#1235](#1235)) ([b94a021](b94a021)) * **sources/bigquery:** Add support for user-credential passthrough ([#1067](#1067)) ([650e2e2](650e2e2)) * **tool/looker:** Add support for `description` field in looker tool ([#1199](#1199)) ([97f0dd2](97f0dd2)) * **tools/bigquery-ask-data-insights:** Add bigquery `ask-data-insights` tool ([#932](#932)) ([7651357](7651357)) * **tools/bigquery-forecast:** Add bigqueryforecast tool ([#1148](#1148)) ([2ad0ccf](2ad0ccf)) * **tools/firestore-add-documents:** Add firestore-add-documents tool ([#1107](#1107)) ([ee4a70a](ee4a70a)) * **tools/firestore-update-document:** Add firestore-update-document tool ([#1191](#1191)) ([0010123](0010123)) * **tools/looker:** Control over whether hidden objects are surfaced ([#1222](#1222)) ([bc91559](bc91559)) * **trino:** Add Trino source and tools ([#948](#948)) ([7dd123b](7dd123b)) ### Bug Fixes * **tools/looker:** Lookergetdashboards uses proper Authorized helper func ([#1255](#1255)) ([00866bc](00866bc)) * **tools/mongodb-find-one:** ProjectPayload unmarshaling ([#1167](#1167)) ([8ea6a98](8ea6a98)) * **tools/mysql:** Fix encoded text for mysql ([#1161](#1161)) ([a37cfa8](a37cfa8)), closes [#840](#840) --- 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> 1a6dfe8
🤖 I have created a release *beep* *boop* --- ## [0.13.0](googleapis/genai-toolbox@v0.12.0...v0.13.0) (2025-08-27) ### ⚠ BREAKING CHANGES * **prebuilt/alloydb:** Add bearer token support for alloydb-wait-for-operation ([googleapis#1183](googleapis#1183)) ### Features * Add capability to set default for environment variable in config ([googleapis#1248](googleapis#1248)) ([5bcd52e](googleapis@5bcd52e)) * **firebird:** Add Firebird SQL 2.5+ source and tool ([googleapis#1011](googleapis#1011)) ([4f6b806](googleapis@4f6b806)) * **oceanbase:** Add Oceanbase source and tool ([googleapis#895](googleapis#895)) ([6fc4982](googleapis@6fc4982)) * **server/mcp:** Support `ping` mechanism ([googleapis#1178](googleapis#1178)) ([5dcc66c](googleapis@5dcc66c)) * **server:** Fail-fast on environment variable substitution ([googleapis#1177](googleapis#1177)) ([212aaba](googleapis@212aaba)) * **server:** Implement Tool call auth error propagation ([googleapis#1235](googleapis#1235)) ([b94a021](googleapis@b94a021)) * **sources/bigquery:** Add support for user-credential passthrough ([googleapis#1067](googleapis#1067)) ([650e2e2](googleapis@650e2e2)) * **tool/looker:** Add support for `description` field in looker tool ([googleapis#1199](googleapis#1199)) ([97f0dd2](googleapis@97f0dd2)) * **tools/bigquery-ask-data-insights:** Add bigquery `ask-data-insights` tool ([googleapis#932](googleapis#932)) ([7651357](googleapis@7651357)) * **tools/bigquery-forecast:** Add bigqueryforecast tool ([googleapis#1148](googleapis#1148)) ([2ad0ccf](googleapis@2ad0ccf)) * **tools/firestore-add-documents:** Add firestore-add-documents tool ([googleapis#1107](googleapis#1107)) ([ee4a70a](googleapis@ee4a70a)) * **tools/firestore-update-document:** Add firestore-update-document tool ([googleapis#1191](googleapis#1191)) ([0010123](googleapis@0010123)) * **tools/looker:** Control over whether hidden objects are surfaced ([googleapis#1222](googleapis#1222)) ([bc91559](googleapis@bc91559)) * **trino:** Add Trino source and tools ([googleapis#948](googleapis#948)) ([7dd123b](googleapis@7dd123b)) ### Bug Fixes * **tools/looker:** Lookergetdashboards uses proper Authorized helper func ([googleapis#1255](googleapis#1255)) ([00866bc](googleapis@00866bc)) * **tools/mongodb-find-one:** ProjectPayload unmarshaling ([googleapis#1167](googleapis#1167)) ([8ea6a98](googleapis@8ea6a98)) * **tools/mysql:** Fix encoded text for mysql ([googleapis#1161](googleapis#1161)) ([a37cfa8](googleapis@a37cfa8)), closes [googleapis#840](googleapis#840) --- 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> 1a6dfe8
Add support for Trino distributed SQL query engine with complete implementation including sources, tools, documentation, and tests.
Summary
and prebuilt configurationsFeatures
Authentication Support
Tools
Cross-Catalog Queries
Test Plan
Ref #880