SQL Translate
Requirements
Agent: builder or migrator (may write translated SQL to files)
Tools used: sql_translate, read, write, altimate_core_validate
Translate SQL queries from one database dialect to another using sqlglot's transpilation engine.
Workflow
Determine source and target dialects — If the user did not specify both dialects, ask which source and target dialects to use. Common dialects: snowflake, bigquery, postgres, mysql, tsql, hive, spark, databricks, redshift, duckdb.
Get the SQL to translate — Either:
- Read from a file path provided by the user (use
read)
- Accept inline SQL from the user's message
- Read from clipboard or stdin if mentioned
Call sql_translate with:
sql: The SQL query text
source_dialect: The source dialect
target_dialect: The target dialect
Review the result:
- If
success is true, present the translated SQL
- If there are
warnings, explain each one and what may need manual adjustment
- If
success is false, explain the error and suggest fixes
Format the output showing:
- Original SQL (labeled with source dialect)
- Translated SQL (labeled with target dialect)
- Any warnings about lossy translations or features that need manual review
Offer next steps if applicable:
- Suggest running
altimate_core_validate on the translated SQL to verify syntax
- Offer to write the translated SQL to a file
- Offer to translate additional queries
Usage
The user invokes this skill with optional dialect and SQL arguments:
/sql-translate — Interactive: ask for source dialect, target dialect, and SQL
/sql-translate snowflake postgres — Translate from Snowflake to PostgreSQL (will ask for SQL)
/sql-translate snowflake postgres SELECT DATEADD(day, 7, CURRENT_TIMESTAMP()) — Full inline translation
Supported Dialects
| Dialect |
Key |
| Snowflake |
snowflake |
| BigQuery |
bigquery |
| PostgreSQL |
postgres |
| MySQL |
mysql |
| SQL Server |
tsql |
| Hive |
hive |
| Spark SQL |
spark |
| Databricks |
databricks |
| Redshift |
redshift |
| DuckDB |
duckdb |
| SQLite |
sqlite |
| Oracle |
oracle |
| Trino/Presto |
trino / presto |
Use the tools: sql_translate, read, write, altimate_core_validate.
1---2name: sql-translate3description: Translate SQL queries between database dialects (Snowflake, BigQuery, PostgreSQL, MySQL, etc.)4---56# SQL Translate78## Requirements9**Agent:** builder or migrator (may write translated SQL to files)10**Tools used:** sql_translate, read, write, altimate_core_validate1112Translate SQL queries from one database dialect to another using sqlglot's transpilation engine.1314## Workflow15161. **Determine source and target dialects** — If the user did not specify both dialects, ask which source and target dialects to use. Common dialects: `snowflake`, `bigquery`, `postgres`, `mysql`, `tsql`, `hive`, `spark`, `databricks`, `redshift`, `duckdb`.17182. **Get the SQL to translate** — Either:19 - Read from a file path provided by the user (use `read`)20 - Accept inline SQL from the user's message21 - Read from clipboard or stdin if mentioned22233. **Call `sql_translate`** with:24 - `sql`: The SQL query text25 - `source_dialect`: The source dialect26 - `target_dialect`: The target dialect27284. **Review the result**:29 - If `success` is true, present the translated SQL30 - If there are `warnings`, explain each one and what may need manual adjustment31 - If `success` is false, explain the error and suggest fixes32335. **Format the output** showing:34 - Original SQL (labeled with source dialect)35 - Translated SQL (labeled with target dialect)36 - Any warnings about lossy translations or features that need manual review37386. **Offer next steps** if applicable:39 - Suggest running `altimate_core_validate` on the translated SQL to verify syntax40 - Offer to write the translated SQL to a file41 - Offer to translate additional queries4243## Usage4445The user invokes this skill with optional dialect and SQL arguments:46- `/sql-translate` — Interactive: ask for source dialect, target dialect, and SQL47- `/sql-translate snowflake postgres` — Translate from Snowflake to PostgreSQL (will ask for SQL)48- `/sql-translate snowflake postgres SELECT DATEADD(day, 7, CURRENT_TIMESTAMP())` — Full inline translation4950## Supported Dialects5152| Dialect | Key |53|---------|-----|54| Snowflake | `snowflake` |55| BigQuery | `bigquery` |56| PostgreSQL | `postgres` |57| MySQL | `mysql` |58| SQL Server | `tsql` |59| Hive | `hive` |60| Spark SQL | `spark` |61| Databricks | `databricks` |62| Redshift | `redshift` |63| DuckDB | `duckdb` |64| SQLite | `sqlite` |65| Oracle | `oracle` |66| Trino/Presto | `trino` / `presto` |6768Use the tools: `sql_translate`, `read`, `write`, `altimate_core_validate`.