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
| Tool |
Purpose |
Integration Method |
| SQLGlot |
Universal SQL parser |
Library |
| AWS SCT |
Schema conversion |
CLI |
| ora2pg |
Oracle to PostgreSQL |
CLI |
| pgLoader |
MySQL to PostgreSQL |
CLI |
| SSMA |
SQL Server migration |
CLI |
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
1---
2name: query-translator
3description: Translate SQL queries between different database dialects with function mapping and optimization
4allowed-tools: ["Bash", "Read", "Write", "Grep", "Glob", "Edit"]
5graph:
6 domains: [domain:software-engineering]
7 specializations: [specialization:code-migration-modernization]
8 skillAreas: [skill-area:database-migrations-zero-downtime, skill-area:schema-evolution]
9 roles: [role:data-engineer, role:backend-engineer]
10 workflows: [workflow:technical-debt-reduction]
11 topics: [topic:refactoring]
12metadata:
13 source: https://skillmd.com/skills/a5c-ai/query-translator
14---
15
16# Query Translator Skill
17
18Translates SQL queries between different database dialects, handling function mapping, syntax differences, and performance optimization.
19
20## Purpose
21
22Enable SQL migration for:
23- Dialect conversion
24- Function mapping
25- Syntax translation
26- Performance hint conversion
27- Query optimization suggestions
28
29## Capabilities
30
31### 1. Dialect Conversion
32- Oracle to PostgreSQL
33- SQL Server to MySQL
34- MySQL to PostgreSQL
35- And more combinations
36
37### 2. Function Mapping
38- Date/time functions
39- String functions
40- Math functions
41- Custom function equivalents
42
43### 3. Syntax Translation
44- Pagination (LIMIT/OFFSET/ROWNUM)
45- String concatenation
46- NULL handling
47- Boolean expressions
48
49### 4. Performance Hint Conversion
50- Index hints
51- Join hints
52- Optimizer directives
53- Execution plan guidance
54
55### 5. Query Optimization Suggestions
56- Index recommendations
57- Query restructuring
58- Join optimization
59- Subquery refactoring
60
61## Tool Integrations
62
63| Tool | Purpose | Integration Method |
64|------|---------|-------------------|
65| SQLGlot | Universal SQL parser | Library |
66| AWS SCT | Schema conversion | CLI |
67| ora2pg | Oracle to PostgreSQL | CLI |
68| pgLoader | MySQL to PostgreSQL | CLI |
69| SSMA | SQL Server migration | CLI |
70
71## Output Schema
72
73```json
74{
75 "translationId": "string",
76 "timestamp": "ISO8601",
77 "source": {
78 "dialect": "string",
79 "query": "string"
80 },
81 "target": {
82 "dialect": "string",
83 "query": "string"
84 },
85 "transformations": [
86 {
87 "type": "function|syntax|hint",
88 "original": "string",
89 "translated": "string",
90 "notes": "string"
91 }
92 ],
93 "optimizations": [],
94 "warnings": [],
95 "manualReviewNeeded": []
96}
97```
98
99## Integration with Migration Processes
100
101- **database-schema-migration**: Query migration
102- **cloud-migration**: Cloud database adaptation
103
104## Related Skills
105
106- `schema-comparator`: Schema analysis
107- `data-migration-validator`: Validation queries
108
109## Related Agents
110
111- `database-migration-orchestrator`: Uses for migration