Skip to content
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
36 changes: 28 additions & 8 deletions cmd/internal/tools_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1832,18 +1832,22 @@ func TestPrebuiltTools(t *testing.T) {
name: "mysql prebuilt tools",
in: mysql_config,
wantToolset: server.ToolsetConfigs{
"mysql_database_tools": tools.ToolsetConfig{
Name: "mysql_database_tools",
ToolNames: []string{"execute_sql", "list_tables", "get_query_plan", "list_active_queries", "list_tables_missing_unique_indexes", "list_table_fragmentation"},
"data": tools.ToolsetConfig{
Name: "data",
ToolNames: []string{"execute_sql", "list_tables", "get_query_plan", "list_active_queries"},
},
"monitor": tools.ToolsetConfig{
Name: "monitor",
ToolNames: []string{"get_query_plan", "list_active_queries", "list_table_fragmentation", "list_tables_missing_unique_indexes"},
},
},
},
{
name: "mssql prebuilt tools",
in: mssql_config,
wantToolset: server.ToolsetConfigs{
"mssql_database_tools": tools.ToolsetConfig{
Name: "mssql_database_tools",
"data": tools.ToolsetConfig{
Name: "data",
ToolNames: []string{"execute_sql", "list_tables"},
},
},
Expand Down Expand Up @@ -1882,9 +1886,25 @@ func TestPrebuiltTools(t *testing.T) {
name: "postgres prebuilt tools",
in: postgresconfig,
wantToolset: server.ToolsetConfigs{
"postgres_database_tools": tools.ToolsetConfig{
Name: "postgres_database_tools",
ToolNames: []string{"execute_sql", "list_tables", "list_active_queries", "list_available_extensions", "list_installed_extensions", "list_autovacuum_configurations", "list_memory_configurations", "list_top_bloated_tables", "list_replication_slots", "list_invalid_indexes", "get_query_plan", "list_views", "list_schemas", "database_overview", "list_triggers", "list_indexes", "list_sequences", "long_running_transactions", "list_locks", "replication_stats", "list_query_stats", "get_column_cardinality", "list_publication_tables", "list_tablespaces", "list_pg_settings", "list_database_stats", "list_roles", "list_table_stats", "list_stored_procedure"},
"data": tools.ToolsetConfig{
Name: "data",
ToolNames: []string{"execute_sql", "list_tables", "list_views", "list_schemas", "list_triggers", "list_indexes", "list_sequences", "list_stored_procedure"},
},
"monitor": tools.ToolsetConfig{
Name: "monitor",
ToolNames: []string{"list_query_stats", "get_query_plan", "list_database_stats", "list_active_queries", "long_running_transactions", "list_locks"},
},
"health": tools.ToolsetConfig{
Name: "health",
ToolNames: []string{"list_top_bloated_tables", "list_invalid_indexes", "list_table_stats", "get_column_cardinality", "list_autovacuum_configurations", "list_tablespaces", "database_overview", "list_pg_settings"},
},
"view-config": tools.ToolsetConfig{
Name: "view-config",
ToolNames: []string{"list_available_extensions", "list_installed_extensions", "list_memory_configurations", "list_pg_settings", "database_overview"},
},
Comment thread
averikitsch marked this conversation as resolved.
"replication": tools.ToolsetConfig{
Name: "replication",
ToolNames: []string{"replication_stats", "list_replication_slots", "list_publication_tables", "list_roles", "list_pg_settings", "database_overview"},
},
},
},
Expand Down
38 changes: 18 additions & 20 deletions internal/prebuiltconfigs/tools/mssql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,23 @@
# limitations under the License.

sources:
mssql-source:
kind: mssql
host: ${MSSQL_HOST:localhost}
port: ${MSSQL_PORT:1433}
database: ${MSSQL_DATABASE}
user: ${MSSQL_USER}
password: ${MSSQL_PASSWORD}
mssql-source:
kind: mssql
host: ${MSSQL_HOST:localhost}
port: ${MSSQL_PORT:1433}
database: ${MSSQL_DATABASE}
user: ${MSSQL_USER}
password: ${MSSQL_PASSWORD}
tools:
execute_sql:
kind: mssql-execute-sql
source: mssql-source
description: Use this tool to execute SQL.

list_tables:
kind: mssql-list-tables
source: mssql-source
description: "Lists detailed schema information (object type, columns, constraints, indexes, triggers, comment) as JSON for user-created tables (ordinary or partitioned). Filters by a comma-separated list of names. If names are omitted, lists all tables in user schemas."

execute_sql:
kind: mssql-execute-sql
source: mssql-source
description: Use this tool to execute SQL.
list_tables:
kind: mssql-list-tables
source: mssql-source
description: "Lists detailed schema information (object type, columns, constraints, indexes, triggers, comment) as JSON for user-created tables (ordinary or partitioned). Filters by a comma-separated list of names. If names are omitted, lists all tables in user schemas."
toolsets:
mssql_database_tools:
- execute_sql
- list_tables
data:
- execute_sql
- list_tables
8 changes: 5 additions & 3 deletions internal/prebuiltconfigs/tools/mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ tools:
kind: mysql-list-table-fragmentation
source: mysql-source
description: List table fragmentation in MySQL, by calculating the size of the data and index files and free space allocated to each table. The query calculates fragmentation percentage which represents the proportion of free space relative to the total data and index size. Storage can be reclaimed for tables with high fragmentation using OPTIMIZE TABLE.

toolsets:
mysql_database_tools:
data:
- execute_sql
- list_tables
- get_query_plan
- list_active_queries
- list_tables_missing_unique_indexes
monitor:
- get_query_plan
- list_active_queries
- list_table_fragmentation
- list_tables_missing_unique_indexes
Loading
Loading