Skip to content

Conversation

@abhinavm24
Copy link
Contributor

@abhinavm24 abhinavm24 commented Jul 22, 2025

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

  • Unit tests pass for source DSN generation
  • Unit tests pass for tool parameter validation
  • Project builds successfully with new dependencies
  • Documentation includes comprehensive examples

Ref #880

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
@abhinavm24 abhinavm24 requested a review from a team as a code owner July 22, 2025 04:33
@google-cla
Copy link

google-cla bot commented Jul 22, 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.

@abhinavm24 abhinavm24 marked this pull request as draft July 22, 2025 05:14
@bpranava bpranava mentioned this pull request Jul 23, 2025
1 task
@duwenxin99
Copy link
Contributor

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!

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 @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

@Yuan325 Yuan325 added the status: waiting for response Status: reviewer is awaiting feedback or responses from the author before proceeding. label Aug 14, 2025
@abhinavm24
Copy link
Contributor Author

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

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

Addressed

@abhinavm24 abhinavm24 marked this pull request as ready for review August 15, 2025 15:50
@abhinavm24 abhinavm24 requested a review from Yuan325 August 15, 2025 15:50
- 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
@Yuan325
Copy link
Contributor

Yuan325 commented Aug 19, 2025

/gcbrun

@Yuan325 Yuan325 force-pushed the feat/add-trino-support branch from 9abd6c4 to c787b0b Compare August 19, 2025 00:20
@Yuan325 Yuan325 force-pushed the feat/add-trino-support branch from c787b0b to b3b76d1 Compare August 19, 2025 00:24
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 @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 :)

@Yuan325 Yuan325 changed the title feat: Add comprehensive Trino support feat(trino): Add Trino source and tools Aug 19, 2025
@abhinavm24
Copy link
Contributor Author

abhinavm24 commented Aug 20, 2025

@Yuan325 The generated tables by faker are readonly. We can use https://trino.io/docs/current/connector/memory.html instead

@Yuan325 Yuan325 force-pushed the feat/add-trino-support branch from 48563a2 to 77e9139 Compare August 21, 2025 23:29
@Yuan325 Yuan325 force-pushed the feat/add-trino-support branch from 77e9139 to 635a801 Compare August 21, 2025 23:35
@Yuan325 Yuan325 self-requested a review August 21, 2025 23:36
@Yuan325 Yuan325 added tests: run Label to trigger Github Action tests. and removed status: waiting for response Status: reviewer is awaiting feedback or responses from the author before proceeding. labels Aug 21, 2025
@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Aug 21, 2025
@Yuan325
Copy link
Contributor

Yuan325 commented Aug 21, 2025

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!! 🙏

@Yuan325
Copy link
Contributor

Yuan325 commented Aug 21, 2025

/gcbrun

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

Yuan325 commented Aug 21, 2025

/gcbrun

@Yuan325 Yuan325 added the tests: run Label to trigger Github Action tests. label Aug 21, 2025
@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Aug 21, 2025
@Yuan325 Yuan325 enabled auto-merge (squash) August 21, 2025 23:54
@Yuan325 Yuan325 merged commit 7dd123b into googleapis:main Aug 22, 2025
12 checks passed
github-actions bot pushed a commit that referenced this pull request Aug 22, 2025
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
github-actions bot pushed a commit to renovate-bot/googleapis-_-genai-toolbox that referenced this pull request Aug 22, 2025
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
github-actions bot pushed a commit to bhardwajRahul/genai-toolbox that referenced this pull request Aug 22, 2025
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
@abhinavm24 abhinavm24 deleted the feat/add-trino-support branch August 22, 2025 04:39
github-actions bot pushed a commit to Jaleel-zhu/genai-toolbox that referenced this pull request Aug 22, 2025
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
Yuan325 added a commit that referenced this pull request Aug 27, 2025
🤖 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>
github-actions bot pushed a commit that referenced this pull request Aug 27, 2025
🤖 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
github-actions bot pushed a commit to renovate-bot/googleapis-_-genai-toolbox that referenced this pull request Aug 27, 2025
🤖 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants