# SQL Translate Pro **[English]** | [中文] | [日本語] **SQL Translate Pro** is an intelligent SQL generation tool powered by Google Gemini. It helps developers and data analysts quickly build complex SQL queries by analyzing table structures, dictionary definitions, and natural language requirements. It automatically handles table joins and dictionary code translations. --- ### 🌟 Key Features * **Intelligent Generation**: Converts natural language requirements into precise SQL queries. * **Dictionary Translation**: Automatically identifies code fields (e.g., `status_code`) and joins them with dictionary tables to retrieve readable names. * **Multi-DB Support**: Optimized for MySQL, PostgreSQL, Oracle, SQL Server, Hive, Dameng (Dm), and SQLite. * **Privacy Focused**: Your API Key is stored locally in your browser and used directly for API calls. ### 🚀 How to Use 1. **Select Database**: Choose your target database dialect (e.g., MySQL, Oracle). 2. **Input Schema**: Paste your table DDL or field descriptions. 3. **Input Dictionary**: Describe your dictionary table structure and mapping rules. 4. **Describe Requirement**: Type what you want to query in plain text. 5. **Generate**: Click the button to get ready-to-use SQL. 6. **Settings**: Click the gear icon in the top right to configure your own Google Gemini API Key. --- # SQL Translate Pro (中文) **SQL Translate Pro** 是一款基于 Google Gemini 的智能 SQL 生成工具。它能够根据您提供的表结构、字典表定义以及自然语言查询需求,自动构建复杂的 SQL 查询语句,并智能处理字典代码的翻译(关联查询)。 ### 🌟 主要功能 * **智能生成**:将自然语言需求转化为精确的 SQL 语句。 * **字典自动翻译**:自动识别代码字段(如 `nation_code`)并关联字典表取值,无需手动编写繁琐的 JOIN。 * **多数据库支持**:完美支持 MySQL, PostgreSQL, Oracle, SQL Server, Hive, 达梦数据库 (Dm) 和 SQLite 方言。 * **隐私安全**:支持自定义 API Key,Key 仅保存在本地浏览器中,直接用于 API 请求。 ### 🚀 使用指南 1. **选择数据库**:在左上角下拉框选择目标数据库类型。 2. **输入表结构**:粘贴建表语句 (DDL) 或字段描述信息。 3. **输入字典信息**:描述字典表的结构以及字段关联规则。 4. **描述需求**:用自然语言描述您想要查询的数据(例如:“查询学生信息及其对应的政治面貌中文名”)。 5. **点击生成**:获取纯净的 SQL 代码。 6. **设置 Key**:点击右上角设置按钮,填入您的 Google Gemini API Key 以获得最佳体验。 --- # SQL Translate Pro (日本語) **SQL Translate Pro** は、Google Gemini を搭載したインテリジェントな SQL 生成ツールです。テーブル定義、辞書データ、および自然言語の要件に基づいて、辞書変換(コード値の名称変換)を含む複雑な SQL クエリを自動的に生成します。 ### 🌟 主な機能 * **インテリジェント生成**: 自然言語の要件を正確な SQL クエリに変換します。 * **辞書自動変換**: コード項目(例:`status_code`)を自動的に特定し、辞書テーブルと結合して名称を取得します。 * **マルチDB対応**: MySQL, PostgreSQL, Oracle, SQL Server, Hive, Dameng (Dm), SQLite に最適化されています。 * **プライバシー重視**: API キーはブラウザにローカル保存され、API 呼び出しに直接使用されます。 ### 🚀 使い方 1. **データベース選択**: ターゲットとなるデータベースの種類を選択します。 2. **スキーマ入力**: テーブル作成ステートメント (DDL) またはフィールドの説明を貼り付けます。 3. **辞書情報入力**: 辞書テーブルの構造とマッピングルールを記述します。 4. **要件の記述**: 抽出したいデータを自然言語で入力します。 5. **生成**: ボタンをクリックすると、すぐに使える SQL が生成されます。 6. **設定**: 右上の設定ボタンから、独自の Google Gemini API Key を設定できます。 --- ## 🛠 Setup & Development ```bash # Install dependencies npm install # Start development server npm run dev # Build for production npm run build ```