Skip to content

Commit 42e7743

Browse files
committed
1 parent b34708b commit 42e7743

3 files changed

Lines changed: 86 additions & 69 deletions

File tree

README.md

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
# PawSQL Client
2-
32
[English](README.md) | [中文](README_zh-CN.md)
43

54
## Introduction
5+
PawSQL Client enables developers to access core capabilities of the PawSQL directly within their VS Code development environment. PawSQL provides sosophisticated SQL optimization features including smart index recommendations and query rewriting suggestions.. PawSQL Client requires integration with the PawSQL optimization platform (either [PawSQL Cloud](https://pawsql.com) or enterprise private deployment). For comprehensive SQL optimization capabilities, please refer to the [PawSQL Technical Documentation](https://docs.pawsql.com).
66

7-
PawSQL Client is a plugin for Visual Studio Code that helps developers optimize SQL queries and manage workspaces. Through integration with the PawSQL API, users can easily perform SQL optimization and view optimization results.
7+
[Watch PawSQL Client Demo](https://www.bilibili.com/video/BV19aDBYAEcr/)
88

99
## Features
10-
11-
- **SQL optimization**: Select SQL queries and optimize using the PawSQL API.
12-
13-
- **Workspace management**: Connect to a PawSQL workspace for easy switching and management.
14-
15-
- **Error handling**: Provides detailed error information and friendly prompts.
10+
- **SQL Optimization**: Get optimization recommendation by one click.
11+
- **Intelligent index recommendation**: Recommend optimal indexes based on input SQL syntax, database objects and statistics information
12+
- **Rewrite Optimization**: Recommend semantically equivalent, but more efficient SQLs
13+
- **Performance Validation**: Ensure better performance after SQL rewrite and index recommendation
1614

1715
## Installation
18-
19-
1. Open Visual Studio Code.
20-
21-
2. Go to the Extensions view (`Ctrl+Shift+X` or `Cmd+Shift+X`).
22-
23-
3. Search for "PawSQL" and click Install.
24-
25-
## Instructions
26-
27-
### Configure API key
28-
29-
Before using the plugin, you need to configure the PawSQL API key:
30-
31-
1. Open Settings (`Ctrl+,` or `Cmd+,`).
32-
2. Search for "PawSQL".
33-
3. Enter your API key and save.
34-
35-
### Optimize SQL Queries
36-
37-
1. Select the SQL query to be optimized in the editor.
38-
2. Right-click and select "Optimize SQL" or use the command palette (`Ctrl+Shift+P` or `Cmd+Shift+P`) to enter "Optimize SQL".
39-
3. Click Select Workspace to get it, and click Execute Optimization.
40-
3. Wait for the optimization results and view the report according to the prompts.
41-
42-
### Manage Workspaces
43-
44-
1. Use the command palette (`Ctrl+Shift+P` or `Cmd+Shift+P`) to enter "Select Workspace".
45-
2. Select a workspace from the list to connect.
46-
47-
## Error Handling
48-
49-
During use, if you encounter any problems, the plugin will display detailed error information and solution tips. For example:
50-
51-
- API key not configured: Please add API key in settings.
52-
- Invalid SQL query: Please select valid SQL text to optimize.
16+
1. Open Visual Studio Code
17+
2. Navigate to Extensions view (`Ctrl+Shift+X` or `Cmd+Shift+X`)
18+
3. Search for "PawSQL Client" and click Install
19+
20+
## Initial Setup
21+
When using the extension for the first time, complete these configuration steps:
22+
1. Click the PawSQL icon in the VSCode sidebar to access configuration
23+
2. Fill in the following configuration fields:
24+
- Backend URL (e.g., `https://pawsql.com`)
25+
- Frontend URL (e.g., `https://pawsql.com`)
26+
- API Key (Your PawSQL API key, available in the platform's user settings)
27+
3. Click "Save"
28+
29+
Upon successful configuration, the sidebar will load your workspace list (last 100 workspaces at most).
30+
31+
## Usage Guide
32+
### SQL Optimization in VS Code
33+
Two optimization methods are available in SQL files:
34+
1. **Optimize Using Default Workspace**:
35+
- Click the "Optimize" button in the SQL statement prompt
36+
2. **Optimize Using Specific Workspace**:
37+
- Click the "Optimize..." button in the SQL statement prompt
38+
- Select a workspace from the dropdown menu
39+
40+
### Optimization Results
41+
After optimization completion:
42+
- Results are displayed in VSCode's WebView
43+
- Click "View Detailed Optimization in Browser" for additional information, including:
44+
- SQL comparison
45+
- Execution plan comparison
46+
- Detailed analysis
47+
48+
Recent optimization results (last 10 per workspace) automatically appear in the sidebar under their respective workspaces.
49+
50+
## Important Notes
51+
- Ensure PawSQL Backend URL and Frontend URL are accessible
52+
- API Key is your unique identifier for [PawSQL Cloud](https://pawsql.com) or private deployment platform, available in the platform's user settings

README_zh-CN.md

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,62 @@
44

55
## 简介
66

7-
PawSQL Client是一款为 Visual Studio Code 提供的插件,旨在帮助开发者优化 SQL 查询并管理工作空间。通过与 PawSQL API 的集成,用户可以方便地执行 SQL 优化,查看优化结果。
7+
PawSQL Client让开发者能够在VS Code开发环境中直接使用PawSQL引擎强大的SQL优化能力,包括智能索引推荐、查询重写建议、自动化性能验证等。PawSQL Client需要结合PawSQL优化平台([PawSQL Cloud](https://pawsql.com)或企业私域部署的PawSQL优化平台)一起使用。关于更全面的PawSQL的SQL优化能力,请参考[PawSQL官方文档](https://docs.pawsql.com)
8+
9+
[PawSQL Client](https://www.bilibili.com/video/BV19aDBYAEcr/)
810

911
## 功能
1012

11-
- **SQL 优化**:选择 SQL 查询并使用 PawSQL API 进行优化。
12-
- **工作空间管理**:连接到 PawSQL 工作空间,方便地切换和管理。
13-
- **错误处理**:提供详细的错误信息和友好的提示。
13+
- **SQL 优化**:一键完成SQL性能优化
14+
- **智能索引推荐**: 推荐各种语法组合条件下的最优索引组合
15+
- **查询重写优化**: 推荐语义等价,但执行性能更高的SQL语句
16+
- **自动化性能验证**: 精确了解优化后的SQL性能提示效果
17+
- **优化结果展示**:支持在 VSCode 内查看优化结果,并可跳转至浏览器查看更详细信息
1418

15-
## 安装
19+
## 插件安装
1620

17-
1. 打开 Visual Studio Code
18-
2. 转到扩展视图 (`Ctrl+Shift+X``Cmd+Shift+X`)
19-
3. 搜索 PawSQL并点击安装
21+
1. 打开 Visual Studio Code
22+
2. 转到插件视图 (`Ctrl+Shift+X``Cmd+Shift+X`)
23+
3. 搜索 "PawSQL Client" 并点击安装
2024

21-
## 使用说明
25+
## 初始配置
26+
27+
首次使用插件时,需要完成以下配置步骤:
2228

23-
### 配置 API 密钥
29+
1. 点击 VSCode 左侧边栏的 PawSQL 图标,进行PawSQL配置
30+
2. 在配置页面中正确填写以下配置项:
31+
- Backend URL (例如:`https://pawsql.com`)
32+
- Frontend URL (例如:`https://pawsql.com`)
33+
- API Key (您的 PawSQL API 密钥,可以在优化平台的用户设置页面查看)
34+
3. 点击"保存"按钮
35+
36+
配置成功后,左侧边栏将加载当前用户的工作空间列表(最近 100 个)。
37+
38+
## 使用说明
2439

25-
在使用插件之前,您需要配置 PawSQL API 密钥:
40+
### 在VS Code环境中进行SQL 优化
2641

27-
1. 打开设置 (`Ctrl+,``Cmd+,`)。
28-
2. 搜索 “PawSQL”。
29-
3. 输入您的 API 密钥并保存。
42+
在 SQL 文件中提供两种优化方式:
3043

31-
### 优化 SQL 查询
44+
1. **使用默认工作空间执行优化**
45+
- 在 SQL 语句上方的提示中点击"Optimize"按钮
46+
2. **选择特定工作空间优化**
47+
- 点击 SQL 语句提示中的"Optimize..."按钮
48+
- 从弹出的下拉列表中选择工作空间,进行优化
3249

33-
1. 在编辑器中选择需要优化的 SQL 查询。
34-
2. 右键单击,选择 “优化 SQL” 或使用命令面板 (`Ctrl+Shift+P``Cmd+Shift+P`) 输入 “优化 SQL”。
35-
3. 点击选择工作空间获取,点击执行优化。
36-
3. 等待优化结果,并根据提示查看报告。
50+
### 查看优化结果
3751

38-
### 管理工作空间
52+
优化完成后:
3953

40-
1. 使用命令面板 (`Ctrl+Shift+P``Cmd+Shift+P`) 输入 “选择工作空间”。
41-
2. 从列表中选择一个工作空间进行连接。
54+
- 优化结果将在 VSCode 内的 WebView 中显示
55+
- 点击"在浏览器中查看优化详情"可查看更多信息,包括:
56+
- SQL 对比
57+
- 执行计划对比
58+
- 其他详细分析
4259

43-
## 错误处理
60+
已执行的优化结果将自动显示在左侧边栏对应工作空间的优化列表中(每个工作空间的最近10个优化)。
4461

45-
在使用过程中,如果遇到任何问题,插件会显示详细的错误信息和解决提示。例如:
62+
## 注意事项
4663

47-
- API 密钥未配置:请在设置中添加 API 密钥。
48-
- SQL 查询无效:请选择有效的 SQL 文本进行优化。
64+
- 确保配置的PawSQL的 Backend URL 和 Frontend URL 可以正常访问
65+
- API Key为您在[PawSQL Cloud](https://pawsql.com)或私域部署的PawSQL优化平台上的唯一标识,可以在优化平台的用户设置页面查看

image.png

97.6 KB
Loading

0 commit comments

Comments
 (0)