a5c-ai/babysitter / library/specializations/code-migration-modernization/skills/query-translator
query-translator
VerifiedTranslate SQL queries between different database dialects with function mapping and optimization
README.md
View on GitHub# Query Translator Skill
## Overview
The Query Translator skill converts SQL queries between database dialects. It handles function mapping, syntax differences, and provides optimization suggestions.
## Quick Start
### Prerequisites
- Source queries to translate
- Target database type
- SQLGlot or similar tool
### Basic Usage
1. **Parse source query**
```python
import sqlglot
ast = sqlglot.parse("SELECT * FROM t", read="oracle")
```
2. **Translate**
```python
translated = sqlglot.transpile(
"SELECT * FROM t",
read="oracle",
write="postgres"
)[0]
```
3. **Verify and optimize**
- Test on target database
- Review execution plan
- Apply optimizations
## Features
### Dialect Support
| From | To | Support Level |
|------|-----|--------------|
| Oracle | PostgreSQL | High |
| SQL Server | MySQL | High |
| MySQL | PostgreSQL | High |
| Snowflake | BigQuery | Medium |
### Translation Types
- Function mapping
- Syntax adaptation
- Data type conversion
- Performance hints
## Configuration
```json
{
"source": {
"dialect": "oracle",
"version": "19c"
},
"target": {
"dialect": "postgresql",
"version": "15"
},
"options": {
"preserveComments": true,
"suggestOptimizations": true
}
}
```
## Related Documentation
- [SKILL.md](./SKILL.md) - Full skill specification
- [SQLGlot](https://github.com/tobymao/sqlglot)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 119k | Updated | Claude CodeCodex | Verified | Install |
| 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: 119k | Updated | Claude CodeCodex | Verified | Install |
| 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: 118k | Updated | Claude CodeCodex | Verified | Install |
| 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: 118k | Updated | Claude CodeCodex | Verified | Install |