Agent SkillsAltimateAI/altimate-code › sql-translate

sql-translate

GitHub

用于在不同数据库方言(如Snowflake、BigQuery、PostgreSQL等)之间转换SQL查询。支持读取文件、内联输入,提供语法校验及警告提示,帮助开发者实现跨数据库平台的SQL迁移与适配。

.opencode/skills/sql-translate/SKILL.md AltimateAI/altimate-code

Trigger Scenarios

需要将SQL从一种数据库方言转换为另一种 用户指定源和目标方言并请求翻译SQL

Install

npx skills add AltimateAI/altimate-code --skill sql-translate -g -y
More Options

Non-standard path

npx skills add https://github.com/AltimateAI/altimate-code/tree/main/.opencode/skills/sql-translate -g -y

Use without installing

npx skills use AltimateAI/altimate-code@sql-translate

指定 Agent (Claude Code)

npx skills add AltimateAI/altimate-code --skill sql-translate -a claude-code -g -y

安装 repo 全部 skill

npx skills add AltimateAI/altimate-code --all -g -y

预览 repo 内 skill

npx skills add AltimateAI/altimate-code --list

SKILL.md

Frontmatter
{
    "name": "sql-translate",
    "description": "Translate SQL queries between database dialects (Snowflake, BigQuery, PostgreSQL, MySQL, etc.)"
}

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

  1. 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.

  2. 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
  3. Call sql_translate with:

    • sql: The SQL query text
    • source_dialect: The source dialect
    • target_dialect: The target dialect
  4. 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
  5. 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
  6. 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.

Version History

  • 8c9a9a8 Current 2026-07-25 06:35

Same Skill Collection

.opencode/skills/altimate-setup/SKILL.md
.opencode/skills/cost-report/SKILL.md
.opencode/skills/data-parity/SKILL.md
.opencode/skills/dbt-analyze/SKILL.md
.opencode/skills/dbt-docs/SKILL.md
.opencode/skills/dbt-pr-review/SKILL.md
.opencode/skills/dbt-test/SKILL.md
.opencode/skills/dbt-troubleshoot/SKILL.md
.opencode/skills/dbt-unit-tests/SKILL.md
.opencode/skills/lineage-diff/SKILL.md
.opencode/skills/pii-audit/SKILL.md
.opencode/skills/query-optimize/SKILL.md
.opencode/skills/schema-migration/SKILL.md
.opencode/skills/sql-review/SKILL.md
.opencode/skills/teach/SKILL.md
.opencode/skills/train/SKILL.md
.opencode/skills/training-status/SKILL.md
.opencode/skills/data-viz/SKILL.md
.opencode/skills/dbt-develop/SKILL.md
.opencode/skills/dbt-schema-verify/SKILL.md

Metadata

Files
0
Version
e27aeac
Hash
842dcd5d
Indexed
2026-07-25 06:35

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 04:12
浙ICP备14020137号-1 $mapa de visitantes$