Skip to content

Extract one shared helper for the repeated default-database warnings in SQL tools #893

@VaibhavUpreti

Description

@VaibhavUpreti

Why This Matters

several SQL tools repeat the exact same "database defaulted to system DB" warning logic.

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 helper under app/tools/utils/ that takes the default database name and returns the warning string.
  2. Migrate the six tool wrappers above to use that helper.
  3. Do not change the warning text beyond making it consistent.

Tests / Coverage

  • extend the six existing tool test modules
  • add one small direct test module for the new helper
  • assert the warning is present only when the database argument was omitted

Acceptance Criteria

  • the repeated warning string is built in one place
  • all six tools still expose the same response key
  • tests prove warning behavior did not change

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