Skip to content

Extract one shared wrapper helper for the repeated SQL-tool flow #894

@VaibhavUpreti

Description

@VaibhavUpreti

Why This Matters

many SQL tools repeat the same wrapper pattern: resolve config, call integration helper, attach optional warning, return dict.

Read First

  • app/tools/AzureSQLCurrentQueriesTool/__init__.py
  • app/tools/AzureSQLSlowQueriesTool/__init__.py
  • app/tools/PostgreSQLCurrentQueriesTool/__init__.py
  • app/tools/PostgreSQLSlowQueriesTool/__init__.py
  • app/tools/MySQLCurrentProcessesTool/__init__.py
  • app/tools/MariaDBProcessListTool/__init__.py

Scope

  1. Add one small wrapper helper under app/tools/utils/ for the repeated "default DB + call + warning injection" flow.
  2. Migrate only the six tools above in the first pass.
  3. Leave vendor-specific config builders and query functions where they are.

Tests / Coverage

  • keep the existing six tool test modules green
  • add one helper test proving the wrapper preserves returned dicts
  • add one regression test for warning injection after the wrapped call

Acceptance Criteria

  • the repeated wrapper logic exists in one place
  • tool names, schemas, and output keys stay unchanged
  • the scope stays limited to the six listed tools

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomersmaintainabilityImproves long-term code maintainabilityrefactorCodebase cleanup without behavior change

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions