OpenParable
Skip to content
← Back to skills

Query Translator

Development
query-translator

Query Translator is an Agent Skill for development published in the a5c-ai/babysitter repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

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

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/a5c-ai/babysitter/blob/HEAD/library/specializations/code-migration-modernization/skills/query-translator/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/query-translator, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

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