Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
java-version: "17"
distribution: "temurin"
java-package: "jre"
architecture: "x64"

# Install jre MacOS arm64
- name: Install Jre MacOS arm64
Expand All @@ -86,7 +87,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"
# 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'
Expand Down Expand Up @@ -210,7 +211,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' }}
Expand Down Expand Up @@ -346,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)"
}
}
39 changes: 39 additions & 0 deletions chat2db-client/src/components/ConnectionEdit/config/dataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2104,4 +2104,43 @@ export const dataSourceFormConfigs: IConnectionConfig[] = [
},
ssh: sshConfig,
},
// DUCKDB
{
type: DatabaseTypeCode.DUCKDB,
baseInfo: {
items: [
{
defaultValue: '@localhost',
inputType: InputType.INPUT,
labelNameCN: '名称',
labelNameEN: 'Name',
name: 'alias',
required: true,
},
envItem,
{
defaultValue: 'localhost',
inputType: InputType.INPUT,
labelNameCN: '路径',
labelNameEN: 'Host',
name: 'host',
required: true,
styles: {
width: '70%',
},
},
{
defaultValue: 'jdbc:duckdb:{filePath}',
inputType: InputType.INPUT,
labelNameCN: 'URL',
labelNameEN: 'URL',
name: 'url',
required: true,
},
],
pattern: /jdbc:duckdb:\/\/(\w+)/,
template: 'jdbc:duckdb://{host}',
},
ssh: sshConfig,
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export enum InputType {
INPUT = 'input',
PASSWORD = 'password',
SELECT = 'select',
FILE = 'file',
}

export enum AuthenticationType {
Expand Down
1 change: 1 addition & 0 deletions chat2db-client/src/constants/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export enum DatabaseTypeCode {
HIVE = 'HIVE',
KINGBASE = 'KINGBASE',
TIMEPLUS = 'TIMEPLUS',
DUCKDB = 'DUCKDB',
}

export enum ConsoleStatus {
Expand Down
7 changes: 7 additions & 0 deletions chat2db-client/src/constants/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ export const databaseMap: {
// port: 8123,
icon: '\ue8f4',
},
[DatabaseTypeCode.DUCKDB]: {
name: 'DuckDB',
img: moreDBLogo,
code: DatabaseTypeCode.DUCKDB,
// port: 8123,
icon: '\ue8f4',
},
// [DatabaseTypeCode.REDIS]: {
// name: 'Redis',
// img: moreDBLogo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 35 additions & 0 deletions chat2db-server/chat2db-plugins/chat2db-duckdb/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
<groupId>ai.chat2db</groupId>
<artifactId>chat2db-plugins</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>chat2db-duckdb</artifactId>

<dependencies>
<dependency>
<groupId>ai.chat2db</groupId>
<artifactId>chat2db-spi</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<!--The properties configuration file will be placed together with the compiled class file-->
<include>**/*.json</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ai.chat2db.plugin.duckdb;

import ai.chat2db.spi.model.Command;
import ai.chat2db.spi.model.ExecuteResult;
import ai.chat2db.spi.sql.SQLExecutor;

import java.util.List;

public class DuckDBCommandExecutor extends SQLExecutor {

@Override
public List<ExecuteResult> executeSelectTable(Command command) {
String sql = "select * from " +command.getSchemaName() + "." + command.getTableName();
command.setScript(sql);
return execute(command);
}
}
Loading