From 33837ec903ad425851c1016873ba12efbbde82fd Mon Sep 17 00:00:00 2001
From: SwallowGG <1558143046@qq.com>
Date: Mon, 28 Oct 2024 14:42:14 +0800
Subject: [PATCH 1/8] feat:support download task
---
.../chat2db/plugin/clickhouse/builder/ClickHouseSqlBuilder.java | 2 ++
.../chat2db-h2/src/main/java/ai/chat2db/plugin/h2/H2Meta.java | 1 +
.../java/ai/chat2db/plugin/hive/builder/HiveSqlBuilder.java | 2 ++
.../web/api/controller/rdb/converter/RdbWebConverter.java | 2 ++
4 files changed, 7 insertions(+)
diff --git a/chat2db-server/chat2db-plugins/chat2db-clickhouse/src/main/java/ai/chat2db/plugin/clickhouse/builder/ClickHouseSqlBuilder.java b/chat2db-server/chat2db-plugins/chat2db-clickhouse/src/main/java/ai/chat2db/plugin/clickhouse/builder/ClickHouseSqlBuilder.java
index 9f313c27c..0eef415af 100644
--- a/chat2db-server/chat2db-plugins/chat2db-clickhouse/src/main/java/ai/chat2db/plugin/clickhouse/builder/ClickHouseSqlBuilder.java
+++ b/chat2db-server/chat2db-plugins/chat2db-clickhouse/src/main/java/ai/chat2db/plugin/clickhouse/builder/ClickHouseSqlBuilder.java
@@ -10,6 +10,8 @@
import ai.chat2db.spi.model.TableIndex;
import org.apache.commons.lang3.StringUtils;
+import java.util.List;
+
public class ClickHouseSqlBuilder extends DefaultSqlBuilder {
@Override
diff --git a/chat2db-server/chat2db-plugins/chat2db-h2/src/main/java/ai/chat2db/plugin/h2/H2Meta.java b/chat2db-server/chat2db-plugins/chat2db-h2/src/main/java/ai/chat2db/plugin/h2/H2Meta.java
index 1b1cc2fd6..05f938c3b 100644
--- a/chat2db-server/chat2db-plugins/chat2db-h2/src/main/java/ai/chat2db/plugin/h2/H2Meta.java
+++ b/chat2db-server/chat2db-plugins/chat2db-h2/src/main/java/ai/chat2db/plugin/h2/H2Meta.java
@@ -3,6 +3,7 @@
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
import java.util.*;
import java.util.stream.Collectors;
diff --git a/chat2db-server/chat2db-plugins/chat2db-hive/src/main/java/ai/chat2db/plugin/hive/builder/HiveSqlBuilder.java b/chat2db-server/chat2db-plugins/chat2db-hive/src/main/java/ai/chat2db/plugin/hive/builder/HiveSqlBuilder.java
index 02a761df7..a3ca677dd 100644
--- a/chat2db-server/chat2db-plugins/chat2db-hive/src/main/java/ai/chat2db/plugin/hive/builder/HiveSqlBuilder.java
+++ b/chat2db-server/chat2db-plugins/chat2db-hive/src/main/java/ai/chat2db/plugin/hive/builder/HiveSqlBuilder.java
@@ -2,6 +2,7 @@
import ai.chat2db.plugin.hive.type.HiveColumnTypeEnum;
import ai.chat2db.plugin.hive.type.HiveIndexTypeEnum;
+import ai.chat2db.spi.SqlBuilder;
import ai.chat2db.spi.jdbc.DefaultSqlBuilder;
import ai.chat2db.spi.model.Database;
import ai.chat2db.spi.model.Table;
@@ -9,6 +10,7 @@
import ai.chat2db.spi.model.TableIndex;
import org.apache.commons.lang3.StringUtils;
+import java.util.List;
public class HiveSqlBuilder extends DefaultSqlBuilder implements SqlBuilder
{
diff --git a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/converter/RdbWebConverter.java b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/converter/RdbWebConverter.java
index f9c529a5b..7881cf93a 100644
--- a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/converter/RdbWebConverter.java
+++ b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/converter/RdbWebConverter.java
@@ -42,6 +42,8 @@ public abstract class RdbWebConverter {
public abstract DlExecuteParam request2param(DmlRequest request);
+
+ public abstract GroupByParam request2param(GroupByRequest request);
/**
* Parameter conversion
*
From d37fd66981b6d09a63a93692c145149a46c56765 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B4=BA=E5=96=9C?=
<86969353+shanhexi@users.noreply.github.com>
Date: Mon, 28 Oct 2024 22:40:08 +0800
Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9jar?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/release.yml | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 61b492976..c5c31fbdf 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -86,11 +86,7 @@ jobs:
- name: Enable tls1
if: ${{ runner.os == 'Windows' }}
run: |
- # sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "${{ env.JAVA_HOME }}/conf/security/java.security"
- $filePath = "${{ env.JAVA_HOME }}\conf\security\java.security"
- $content = Get-Content $filePath -Raw
- $updatedContent = $content -replace '^(jdk.tls.disabledAlgorithms=)(.*)( TLSv1, TLSv1.1,)(.*)', '$1$2$4'
- $updatedContent | Set-Content $filePath
+ sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "${{ env.JAVA_HOME }}/conf/security/java.security"
shell: pwsh
# java.security open tls1 macOS
From 85b99252f697a4296d94ac9ed143ce4eaac26213 Mon Sep 17 00:00:00 2001
From: SwallowGG <1558143046@qq.com>
Date: Tue, 29 Oct 2024 09:50:57 +0800
Subject: [PATCH 3/8] feat:support download task
---
.github/workflows/release.yml | 34 ++++++++++++++++++++++++----------
1 file changed, 24 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index c5c31fbdf..9f2590a88 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -83,17 +83,31 @@ jobs:
java-package: "jre"
# java.security open tls1 Windows
- - name: Enable tls1
- if: ${{ runner.os == 'Windows' }}
- run: |
- sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "${{ env.JAVA_HOME }}/conf/security/java.security"
- shell: pwsh
-
- # java.security open tls1 macOS
- - name: Enable tls1
- if: ${{ runner.os == 'macOS' }}
+# - name: Enable tls1
+# if: ${{ runner.os == 'Windows' }}
+# run: |
+# sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "${{ env.JAVA_HOME }}/conf/security/java.security"
+# shell: pwsh
+#
+# # java.security open tls1 macOS
+# - name: Enable tls1
+# if: ${{ runner.os == 'macOS' }}
+# run: |
+# sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" $JAVA_HOME/conf/security/java.security
+ # 开放TLS
+ - name: Enable TLS 1.0 and 1.1 in java.security
run: |
- sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" $JAVA_HOME/conf/security/java.security
+ if [ "$RUNNER_OS" = "Windows" ]; then
+ sed -i "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\(TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "$JAVA_HOME/conf/security/java.security"
+ elif [ "$RUNNER_OS" = "Linux" ]; then
+ sed -i "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\(TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "$JAVA_HOME/conf/security/java.security"
+ elif [ "$RUNNER_OS" = "macOS" ]; then
+ sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\(TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "$JAVA_HOME/conf/security/java.security"
+ fi
+ shell: bash
+ env:
+ RUNNER_OS: ${{ runner.os }}
+ JAVA_HOME: ${{ env.JAVA_HOME }}
# Copy jre Windows
- name: Copy Jre for Windows
From cb4fb975d5660c99b4b7961c2dc2414e1b02f118 Mon Sep 17 00:00:00 2001
From: SwallowGG <1558143046@qq.com>
Date: Tue, 29 Oct 2024 16:25:08 +0800
Subject: [PATCH 4/8] feat:support download task
---
.github/workflows/release.yml | 89 +++++++++++++++--------------------
1 file changed, 37 insertions(+), 52 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 9f2590a88..3d83f04f2 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -2,14 +2,14 @@
name: Build Client
# Workflow's trigger
-# Pack when creating tags
+# 在创建标签的时候打包
on:
push:
tags:
- v*
# Workflow's jobs
-# A total of 3 computers are required to run
+# 一共需要3台电脑运行
# windows
# macos-latest x86_64
# macos-latest arm64
@@ -31,7 +31,7 @@ jobs:
- name: Check out git repository
uses: actions/checkout@main
- # Obtaining the version number is not supported by workflow, so a plug-in is used.
+ # 获取版本号 workflow不支持 所以用插件
- name: Create version
id: chat2db_version
uses: bhowell2/github-substring-action@1.0.1
@@ -39,13 +39,13 @@ jobs:
value: ${{ github.ref }}
index_of_str: "refs/tags/v"
- # Output basic information
+ # 输出基础信息
- name: Print basic information
run: |
echo "current environment: ${{ env.CHAT2DB_ENVIRONMENT }}"
echo "current version: ${{ steps.chat2db_version.outputs.substring }}"
- # Install jre Windows
+ # 安装jre Windows
- name: Install Jre for Windows
if: ${{ runner.os == 'Windows' }}
uses: actions/setup-java@main
@@ -54,7 +54,7 @@ jobs:
distribution: "temurin"
java-package: "jre"
- # Install jre MacOS X64
+ # 安装jre MacOS X64
- name: Install Jre MacOS X64
if: ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
uses: actions/setup-java@main
@@ -63,7 +63,7 @@ jobs:
distribution: "temurin"
java-package: "jre"
- # Install jre MacOS arm64
+ # 安装jre MacOS arm64
- name: Install Jre MacOS arm64
if: ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
uses: actions/setup-java@main
@@ -73,7 +73,7 @@ jobs:
java-package: "jre"
architecture: "aarch64"
- # Install jre Linux
+ # 安装jre Linux
- name: Install Jre for Linux
if: ${{ runner.os == 'Linux' }}
uses: actions/setup-java@main
@@ -82,41 +82,26 @@ jobs:
distribution: "temurin"
java-package: "jre"
- # java.security open tls1 Windows
-# - name: Enable tls1
-# if: ${{ runner.os == 'Windows' }}
-# run: |
-# sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "${{ env.JAVA_HOME }}/conf/security/java.security"
-# shell: pwsh
-#
-# # java.security open tls1 macOS
-# - name: Enable tls1
-# if: ${{ runner.os == 'macOS' }}
-# run: |
-# sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" $JAVA_HOME/conf/security/java.security
- # 开放TLS
- - name: Enable TLS 1.0 and 1.1 in java.security
+ # java.security 开放tls1 Windows
+ - name: Enable tls1
+ if: ${{ runner.os == 'Windows' }}
+ run: |
+ sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "${{ env.JAVA_HOME }}/conf/security/java.security"
+
+ # java.security 开放tls1 macOS
+ - name: Enable tls1
+ if: ${{ runner.os == 'macOS' }}
run: |
- if [ "$RUNNER_OS" = "Windows" ]; then
- sed -i "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\(TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "$JAVA_HOME/conf/security/java.security"
- elif [ "$RUNNER_OS" = "Linux" ]; then
- sed -i "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\(TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "$JAVA_HOME/conf/security/java.security"
- elif [ "$RUNNER_OS" = "macOS" ]; then
- sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\(TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "$JAVA_HOME/conf/security/java.security"
- fi
- shell: bash
- env:
- RUNNER_OS: ${{ runner.os }}
- JAVA_HOME: ${{ env.JAVA_HOME }}
-
- # Copy jre Windows
+ sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" $JAVA_HOME/conf/security/java.security
+
+ # 复制jre Windows
- name: Copy Jre for Windows
if: ${{ runner.os == 'Windows' }}
run: |
mkdir chat2db-client/static
cp -r "${{ env.JAVA_HOME }}" chat2db-client/static/jre
- # Copy jre macOS
+ # 复制jre macOS
- name: Copy Jre for macOS
if: ${{ runner.os == 'macOS' }}
run: |
@@ -124,7 +109,7 @@ jobs:
cp -r $JAVA_HOME chat2db-client/static/jre
chmod -R 777 chat2db-client/static/jre/
- # Copy jre Linux
+ # 复制jre Linux
- name: Copy Jre for Linux
if: ${{ runner.os == 'Linux' }}
run: |
@@ -132,7 +117,7 @@ jobs:
cp -r $JAVA_HOME chat2db-client/static/jre
chmod -R 777 chat2db-client/static/jre/
- # Install node
+ # 安装node
- name: Install Node.js
uses: actions/setup-node@main
with:
@@ -140,7 +125,7 @@ jobs:
cache: "yarn"
cache-dependency-path: chat2db-client/yarn.lock
- # Install java
+ # 安装java
- name: Install Java and Maven
uses: actions/setup-java@main
with:
@@ -148,7 +133,7 @@ jobs:
distribution: "temurin"
cache: "maven"
- # Build static file information
+ # 构建静态文件信息
- name: Yarn install & build & copy
run: |
cd chat2db-client
@@ -160,7 +145,7 @@ jobs:
yarn
yarn run build
- # Compile server-side java version
+ # 编译服务端java版本
- name: Build Java
run: mvn clean package -B '-Dmaven.test.skip=true' -f chat2db-server/pom.xml
@@ -175,7 +160,7 @@ jobs:
echo -n ${{ steps.chat2db_version.outputs.substring }} > version
cp -r version ./versions/
- # Copy server-side java to the specified location
+ # 复制服务端java 到指定位置
- name: Copy App
run: |
cp chat2db-server/chat2db-server-start/target/chat2db-server-start.jar chat2db-client/versions/${{ steps.chat2db_version.outputs.substring }}/static/
@@ -220,7 +205,7 @@ jobs:
run: |
xcrun notarytool store-credentials "Chat2DB" --apple-id "${{secrets.MAC_APPLE_ID}}" --password "${{secrets.MAC_APPLE_PASSWORD}}" --team-id "${{secrets.MAC_TEAM_ID}}"
xcrun notarytool submit chat2db-client/release/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg --keychain-profile "Chat2DB"
-
+
# macos arm64
- name: Build/release Electron app for MacOS arm64
if: ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
@@ -260,14 +245,14 @@ jobs:
args: "-c.extraMetadata.version=${{ steps.chat2db_version.outputs.substring }} --linux"
release: true
- # Prepare the required data Windows
+ # 准备要需要的数据 Windows
- name: Prepare upload for Windows
if: runner.os == 'Windows'
run: |
mkdir oss_temp_file
cp -r chat2db-client/release/*Setup*.exe ./oss_temp_file
- # Prepare the required data MacOS x86_64
+ # 准备要需要的数据 MacOS x86_64
- name: Prepare upload for MacOS x86_64
if: ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
run: |
@@ -280,21 +265,21 @@ jobs:
cd static/ && zip -r chat2db-server-start.zip ./
cp -r chat2db-server-start.zip ../../../../oss_temp_file
- # Prepare the required data MacOS arm64
+ # 准备要需要的数据 MacOS arm64
- name: Prepare upload for MacOS arm64
if: ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
run: |
mkdir oss_temp_file
cp -r chat2db-client/release/*.dmg ./oss_temp_file
- # Prepare the required data Linux
+ # 准备要需要的数据 Linux
- name: Prepare upload for Linux
if: runner.os == 'Linux'
run: |
mkdir oss_temp_file
cp -r chat2db-client/release/*.AppImage ./oss_temp_file
- # Upload files to OSS for easy downloading
+ # 把文件上传到OSS 方便下载
- name: Set up oss utils
uses: yizhoumo/setup-ossutil@v1
with:
@@ -306,7 +291,7 @@ jobs:
run: |
ossutil cp -rf --acl=public-read ./oss_temp_file/ oss://chat2db-client/release/${{ steps.chat2db_version.outputs.substring }}/
- # Build completion notification
+ # 构建完成通知
- name: Send dingtalk message for Windows
if: ${{ runner.os == 'Windows' }}
uses: ghostoy/dingtalk-action@master
@@ -319,7 +304,7 @@ jobs:
"text": "# Windows-release-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Windows下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe) "
}
- # Build completion notification
+ # 构建完成通知
- name: Send dingtalk message for MacOS x86_64
if: ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
uses: ghostoy/dingtalk-action@master
@@ -332,7 +317,7 @@ jobs:
"text": "# MacOS-x86_64-release-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Intel芯片下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg) \n ### jar包下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip) "
}
- # Build completion notification
+ # 构建完成通知
- name: Send dingtalk message for MacOS arm64
if: ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
uses: ghostoy/dingtalk-action@master
@@ -345,7 +330,7 @@ jobs:
"text": "# MacOS-arm64-release-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Apple芯片下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg) "
}
- # Build completion notification
+ # 构建完成通知
- name: Send dingtalk message for Linux
if: ${{ runner.os == 'Linux' }}
uses: ghostoy/dingtalk-action@master
From ecd350d41e682065dfd63425cbdda3eea10d38d3 Mon Sep 17 00:00:00 2001
From: SwallowGG <1558143046@qq.com>
Date: Tue, 29 Oct 2024 17:09:42 +0800
Subject: [PATCH 5/8] feat:support download task
---
.github/workflows/release.yml | 66 +++++++++++++++++++----------------
1 file changed, 36 insertions(+), 30 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 3d83f04f2..cca88c92a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -2,14 +2,14 @@
name: Build Client
# Workflow's trigger
-# 在创建标签的时候打包
+# Pack when creating tags
on:
push:
tags:
- v*
# Workflow's jobs
-# 一共需要3台电脑运行
+# A total of 3 computers are required to run
# windows
# macos-latest x86_64
# macos-latest arm64
@@ -31,7 +31,7 @@ jobs:
- name: Check out git repository
uses: actions/checkout@main
- # 获取版本号 workflow不支持 所以用插件
+ # Obtaining the version number is not supported by workflow, so a plug-in is used.
- name: Create version
id: chat2db_version
uses: bhowell2/github-substring-action@1.0.1
@@ -39,13 +39,13 @@ jobs:
value: ${{ github.ref }}
index_of_str: "refs/tags/v"
- # 输出基础信息
+ # Output basic information
- name: Print basic information
run: |
echo "current environment: ${{ env.CHAT2DB_ENVIRONMENT }}"
echo "current version: ${{ steps.chat2db_version.outputs.substring }}"
- # 安装jre Windows
+ # Install jre Windows
- name: Install Jre for Windows
if: ${{ runner.os == 'Windows' }}
uses: actions/setup-java@main
@@ -54,7 +54,7 @@ jobs:
distribution: "temurin"
java-package: "jre"
- # 安装jre MacOS X64
+ # Install jre MacOS X64
- name: Install Jre MacOS X64
if: ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
uses: actions/setup-java@main
@@ -62,8 +62,9 @@ jobs:
java-version: "17"
distribution: "temurin"
java-package: "jre"
+ architecture: "x64"
- # 安装jre MacOS arm64
+ # Install jre MacOS arm64
- name: Install Jre MacOS arm64
if: ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
uses: actions/setup-java@main
@@ -73,7 +74,7 @@ jobs:
java-package: "jre"
architecture: "aarch64"
- # 安装jre Linux
+ # Install jre Linux
- name: Install Jre for Linux
if: ${{ runner.os == 'Linux' }}
uses: actions/setup-java@main
@@ -82,26 +83,31 @@ jobs:
distribution: "temurin"
java-package: "jre"
- # java.security 开放tls1 Windows
+ # java.security open tls1 Windows
- name: Enable tls1
if: ${{ runner.os == 'Windows' }}
run: |
- sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "${{ env.JAVA_HOME }}/conf/security/java.security"
-
- # java.security 开放tls1 macOS
+ # sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" "${{ env.JAVA_HOME }}\conf\security\java.security"
+ $filePath = "${{ env.JAVA_HOME }}\conf\security\java.security"
+ $content = Get-Content $filePath -Raw
+ $updatedContent = $content -replace '^(jdk.tls.disabledAlgorithms=)(.*)( TLSv1, TLSv1.1,)(.*)', '$1$2$4'
+ $updatedContent | Set-Content $filePath
+ shell: pwsh
+
+ # java.security open tls1 macOS
- name: Enable tls1
if: ${{ runner.os == 'macOS' }}
run: |
sed -i '' "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" $JAVA_HOME/conf/security/java.security
- # 复制jre Windows
+ # Copy jre Windows
- name: Copy Jre for Windows
if: ${{ runner.os == 'Windows' }}
run: |
mkdir chat2db-client/static
cp -r "${{ env.JAVA_HOME }}" chat2db-client/static/jre
- # 复制jre macOS
+ # Copy jre macOS
- name: Copy Jre for macOS
if: ${{ runner.os == 'macOS' }}
run: |
@@ -109,7 +115,7 @@ jobs:
cp -r $JAVA_HOME chat2db-client/static/jre
chmod -R 777 chat2db-client/static/jre/
- # 复制jre Linux
+ # Copy jre Linux
- name: Copy Jre for Linux
if: ${{ runner.os == 'Linux' }}
run: |
@@ -117,7 +123,7 @@ jobs:
cp -r $JAVA_HOME chat2db-client/static/jre
chmod -R 777 chat2db-client/static/jre/
- # 安装node
+ # Install node
- name: Install Node.js
uses: actions/setup-node@main
with:
@@ -125,7 +131,7 @@ jobs:
cache: "yarn"
cache-dependency-path: chat2db-client/yarn.lock
- # 安装java
+ # Install java
- name: Install Java and Maven
uses: actions/setup-java@main
with:
@@ -133,7 +139,7 @@ jobs:
distribution: "temurin"
cache: "maven"
- # 构建静态文件信息
+ # Build static file information
- name: Yarn install & build & copy
run: |
cd chat2db-client
@@ -145,7 +151,7 @@ jobs:
yarn
yarn run build
- # 编译服务端java版本
+ # Compile server-side java version
- name: Build Java
run: mvn clean package -B '-Dmaven.test.skip=true' -f chat2db-server/pom.xml
@@ -160,7 +166,7 @@ jobs:
echo -n ${{ steps.chat2db_version.outputs.substring }} > version
cp -r version ./versions/
- # 复制服务端java 到指定位置
+ # Copy server-side java to the specified location
- name: Copy App
run: |
cp chat2db-server/chat2db-server-start/target/chat2db-server-start.jar chat2db-client/versions/${{ steps.chat2db_version.outputs.substring }}/static/
@@ -245,14 +251,14 @@ jobs:
args: "-c.extraMetadata.version=${{ steps.chat2db_version.outputs.substring }} --linux"
release: true
- # 准备要需要的数据 Windows
+ # Prepare the required data Windows
- name: Prepare upload for Windows
if: runner.os == 'Windows'
run: |
mkdir oss_temp_file
cp -r chat2db-client/release/*Setup*.exe ./oss_temp_file
- # 准备要需要的数据 MacOS x86_64
+ # Prepare the required data MacOS x86_64
- name: Prepare upload for MacOS x86_64
if: ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
run: |
@@ -265,21 +271,21 @@ jobs:
cd static/ && zip -r chat2db-server-start.zip ./
cp -r chat2db-server-start.zip ../../../../oss_temp_file
- # 准备要需要的数据 MacOS arm64
+ # Prepare the required data MacOS arm64
- name: Prepare upload for MacOS arm64
if: ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
run: |
mkdir oss_temp_file
cp -r chat2db-client/release/*.dmg ./oss_temp_file
- # 准备要需要的数据 Linux
+ # Prepare the required data Linux
- name: Prepare upload for Linux
if: runner.os == 'Linux'
run: |
mkdir oss_temp_file
cp -r chat2db-client/release/*.AppImage ./oss_temp_file
- # 把文件上传到OSS 方便下载
+ # Upload files to OSS for easy downloading
- name: Set up oss utils
uses: yizhoumo/setup-ossutil@v1
with:
@@ -291,7 +297,7 @@ jobs:
run: |
ossutil cp -rf --acl=public-read ./oss_temp_file/ oss://chat2db-client/release/${{ steps.chat2db_version.outputs.substring }}/
- # 构建完成通知
+ # Build completion notification
- name: Send dingtalk message for Windows
if: ${{ runner.os == 'Windows' }}
uses: ghostoy/dingtalk-action@master
@@ -304,7 +310,7 @@ jobs:
"text": "# Windows-release-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Windows下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe) "
}
- # 构建完成通知
+ # Build completion notification
- name: Send dingtalk message for MacOS x86_64
if: ${{ runner.os == 'macOS' && matrix.arch == 'x86_64' }}
uses: ghostoy/dingtalk-action@master
@@ -317,7 +323,7 @@ jobs:
"text": "# MacOS-x86_64-release-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Intel芯片下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg) \n ### jar包下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip) "
}
- # 构建完成通知
+ # Build completion notification
- name: Send dingtalk message for MacOS arm64
if: ${{ runner.os == 'macOS' && matrix.arch == 'arm64' }}
uses: ghostoy/dingtalk-action@master
@@ -330,7 +336,7 @@ jobs:
"text": "# MacOS-arm64-release-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Apple芯片下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg) "
}
- # 构建完成通知
+ # Build completion notification
- name: Send dingtalk message for Linux
if: ${{ runner.os == 'Linux' }}
uses: ghostoy/dingtalk-action@master
@@ -341,4 +347,4 @@ jobs:
{
"title": "Linux-test-打包完成通知",
"text": "# Linux-test-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Linux下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.AppImage](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.AppImage)"
- }
+ }
\ No newline at end of file
From d383444213d5510b9e46294ec044ef36f676da3d Mon Sep 17 00:00:00 2001
From: SwallowGG <1558143046@qq.com>
Date: Tue, 29 Oct 2024 17:33:01 +0800
Subject: [PATCH 6/8] delete demo data error
---
.../main/resources/db/migration/V2_1_10__REMOVEdEMO.sql | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_10__REMOVEdEMO.sql
diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_10__REMOVEdEMO.sql b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_10__REMOVEdEMO.sql
new file mode 100644
index 000000000..b0f5f6300
--- /dev/null
+++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_10__REMOVEdEMO.sql
@@ -0,0 +1,7 @@
+delete from DATA_SOURCE where ALIAS ='DEMO@db.sqlgpt.cn';
+
+delete from DASHBOARD where id =ID;
+
+delete from CHART where id<=3;
+
+delete from DASHBOARD_CHART_RELATION where CHART_ID<=3;
From 1aa3b570ffd724dc21b5f23bd94b3e5ac19a838c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B4=BA=E5=96=9C?=
<86969353+shanhexi@users.noreply.github.com>
Date: Thu, 31 Oct 2024 17:50:55 +0800
Subject: [PATCH 7/8] =?UTF-8?q?fix:=E7=82=B9=E5=87=BB=E8=87=AA=E5=AE=9A?=
=?UTF-8?q?=E4=B9=89ai=E6=8A=A5=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
chat2db-client/src/blocks/Setting/UpdateDetection/index.tsx | 6 +++---
chat2db-client/src/typings/ai.ts | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/chat2db-client/src/blocks/Setting/UpdateDetection/index.tsx b/chat2db-client/src/blocks/Setting/UpdateDetection/index.tsx
index 38ecfc756..e2c1e7880 100644
--- a/chat2db-client/src/blocks/Setting/UpdateDetection/index.tsx
+++ b/chat2db-client/src/blocks/Setting/UpdateDetection/index.tsx
@@ -41,9 +41,9 @@ const UpdateDetection = memo(
const [notificationApi, notificationDom] = notification.useNotification();
const timesRef = React.useRef(0);
- useEffect(() => {
- checkUpdate();
- }, []);
+ // useEffect(() => {
+ // checkUpdate();
+ // }, []);
const close = () => {};
diff --git a/chat2db-client/src/typings/ai.ts b/chat2db-client/src/typings/ai.ts
index 0ed1d7b2e..da79e4b7f 100644
--- a/chat2db-client/src/typings/ai.ts
+++ b/chat2db-client/src/typings/ai.ts
@@ -1,5 +1,5 @@
export enum AIType {
- // CHAT2DBAI = 'CHAT2DBAI',
+ CHAT2DBAI = 'CHAT2DBAI',
ZHIPUAI = 'ZHIPUAI',
BAICHUANAI='BAICHUANAI',
WENXINAI='WENXINAI',
From 5386f3ea3fdc71b79dfee5bd19c834525cb87d25 Mon Sep 17 00:00:00 2001
From: tmlx1990
Date: Sat, 9 Nov 2024 12:39:00 +0800
Subject: [PATCH 8/8] =?UTF-8?q?fix:1555=20=E4=BF=AE=E5=A4=8D=E9=80=9A?=
=?UTF-8?q?=E4=B9=89=E5=8D=83=E9=97=AE=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=9C?=
=?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=A7=A3=E6=9E=90=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../TongyiChatAIEventSourceListener.java | 39 ++++++++++---------
1 file changed, 21 insertions(+), 18 deletions(-)
diff --git a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/ai/tongyi/listener/TongyiChatAIEventSourceListener.java b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/ai/tongyi/listener/TongyiChatAIEventSourceListener.java
index 388649a9e..c5d4f941e 100644
--- a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/ai/tongyi/listener/TongyiChatAIEventSourceListener.java
+++ b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/ai/tongyi/listener/TongyiChatAIEventSourceListener.java
@@ -19,6 +19,8 @@
import java.io.IOException;
import java.util.Objects;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
/**
* description:OpenAIEventSourceListener
@@ -52,26 +54,27 @@ public void onOpen(EventSource eventSource, Response response) {
@Override
public void onEvent(EventSource eventSource, String id, String type, String data) {
log.info("Tongyi Chat AI response data:{}", data);
- if (data.equals("[DONE]")) {
- log.info("Tongyi Chat AI closed");
+ if (data.contains("\"finish_reason\":\"stop\"")) {
+ TongyiChatCompletions chatCompletions = mapper.readValue(data, TongyiChatCompletions.class);
+ String text = chatCompletions.getOutput().getText();
+ log.info("id: {}, text: {}", chatCompletions.getId(), text);
+ String sqlContent = "";
+ if (text.indexOf("```sql") == -1) {
+ sqlContent = text;
+ } else {
+ Pattern pattern = Pattern.compile("```sql(.*?)```", Pattern.DOTALL);
+ Matcher matcher = pattern.matcher(text);
+ if (matcher.find()) {
+ sqlContent = matcher.group(1).trim();
+ }
+ }
+ Message message = new Message();
+ message.setContent(sqlContent);
sseEmitter.send(SseEmitter.event()
- .id("[DONE]")
- .data("[DONE]")
- .reconnectTime(3000));
- sseEmitter.complete();
- return;
+ .id(null)
+ .data(message)
+ .reconnectTime(3000));
}
-
- TongyiChatCompletions chatCompletions = mapper.readValue(data, TongyiChatCompletions.class);
- String text = chatCompletions.getOutput().getText();
- log.info("id: {}, text: {}", chatCompletions.getId(), text);
-
- Message message = new Message();
- message.setContent(text);
- sseEmitter.send(SseEmitter.event()
- .id(null)
- .data(message)
- .reconnectTime(3000));
}
@Override