Skip to content

a5c-ai/babysitter / library/specializations/code-migration-modernization/skills/query-translator

query-translator

Verified

Translate SQL queries between different database dialects with function mapping and optimization

Query Translator Skill

Translates SQL queries between different database dialects, handling function mapping, syntax differences, and performance optimization.

Purpose

Enable SQL migration for:

  • Dialect conversion
  • Function mapping
  • Syntax translation
  • Performance hint conversion
  • Query optimization suggestions

Capabilities

1. Dialect Conversion

  • Oracle to PostgreSQL
  • SQL Server to MySQL
  • MySQL to PostgreSQL
  • And more combinations

2. Function Mapping

  • Date/time functions
  • String functions
  • Math functions
  • Custom function equivalents

3. Syntax Translation

  • Pagination (LIMIT/OFFSET/ROWNUM)
  • String concatenation
  • NULL handling
  • Boolean expressions

4. Performance Hint Conversion

  • Index hints
  • Join hints
  • Optimizer directives
  • Execution plan guidance

5. Query Optimization Suggestions

  • Index recommendations
  • Query restructuring
  • Join optimization
  • Subquery refactoring

Tool Integrations

ToolPurposeIntegration Method
SQLGlotUniversal SQL parserLibrary
AWS SCTSchema conversionCLI
ora2pgOracle to PostgreSQLCLI
pgLoaderMySQL to PostgreSQLCLI
SSMASQL Server migrationCLI

Output Schema

{
  "translationId": "string",
  "timestamp": "ISO8601",
  "source": {
    "dialect": "string",
    "query": "string"
  },
  "target": {
    "dialect": "string",
    "query": "string"
  },
  "transformations": [
    {
      "type": "function|syntax|hint",
      "original": "string",
      "translated": "string",
      "notes": "string"
    }
  ],
  "optimizations": [],
  "warnings": [],
  "manualReviewNeeded": []
}

Integration with Migration Processes

  • database-schema-migration: Query migration
  • cloud-migration: Cloud database adaptation

Related Skills

  • schema-comparator: Schema analysis
  • data-migration-validator: Validation queries

Related Agents

  • database-migration-orchestrator: Uses for migration
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall