-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(tools/postgres): add list_pg_settings, list_database_stats tools for postgres #2030
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
base: main
Are you sure you want to change the base?
feat(tools/postgres): add list_pg_settings, list_database_stats tools for postgres #2030
Conversation
3624808 to
74d0a8b
Compare
97ffcf5 to
e371d68
Compare
447e3ea to
3d12042
Compare
| func (t Tool) Invoke(ctx context.Context, resourceMgr tools.SourceProvider, params parameters.ParamValues, accessToken tools.AccessToken) (any, error) { | ||
| sliceParams := params.AsSlice() | ||
|
|
||
| results, err := t.pool.Query(ctx, ListDatabaseStats, sliceParams...) |
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.
Do you want to log or throw an error if order by is not the right enum?
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.
Done. Updated the code.
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.
The change does not validate "size" or "commit" enums for order by.
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.
I have approved but we may wan to improve this tool by ensuring the input from LLM will be inserted into the SQL
|
/gcbrun |
9291fbc to
63f6650
Compare
63f6650 to
cc2a454
Compare
…ublication-tables tool (googleapis#1919) Adds a postgresql custom list_publication_tables tool, that returns the details of publication tables present in database. Test Output: <img width="845" height="239" alt="Screenshot 2025-11-11 at 12 50 59 AM" src="https://github.com/user-attachments/assets/b7606e44-c5f6-4fc7-865e-7efadd112eff" /> <img width="1529" height="648" alt="Screenshot 2025-11-11 at 1 15 18 AM" src="https://github.com/user-attachments/assets/6192b772-f0bc-4fb4-8032-ca487434d77c" /> > Should include a concise description of the changes (bug or feature), it's > impact, along with a summary of the solution > Thank you for opening a Pull Request! Before submitting your PR, there are a > few things you can do to make sure it goes smoothly: - [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 googleapis#1738 Co-authored-by: Averi Kitsch <[email protected]> Co-authored-by: Wenxin Du <[email protected]>
cc2a454 to
1bbb657
Compare
|
/gcbrun |
Description
Adds the following tools for Postgres:
(1) list_pg_settings: List configuration parameters for the PostgreSQL server.
(2) list_database_stats: Lists the key performance and activity statistics for each database in the postgreSQL
server.
list_pg_settings:


list_database_stats:


PR Checklist
CONTRIBUTING.md
bug/issue
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
!if this involve a breaking change🛠️ Fixes #<1738>