File tree 4 files changed +21
-3
lines changed
4 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 14
14
"mysql2" : " ^3.11.3" ,
15
15
"json5" : " ^2.2.3" ,
16
16
"pg" : " ^8.10.0" ,
17
- "wikijs" : " ^6.4.1"
17
+ "wikijs" : " ^6.4.1" ,
18
+ "dmdb" :" ^1.0.0"
18
19
},
19
20
"devDependencies" : {
20
21
"@fastgpt/global" : " workspace:*" ,
Original file line number Diff line number Diff line change 1
1
import { Client as PgClient } from 'pg' ; // PostgreSQL 客户端
2
2
import mysql from 'mysql2/promise' ; // MySQL 客户端
3
3
import mssql from 'mssql' ; // SQL Server 客户端
4
-
4
+ import dmdb from 'dmdb' ; //达梦数据库
5
5
type Props = {
6
6
databaseType : string ;
7
7
host : string ;
@@ -67,6 +67,17 @@ const main = async ({
67
67
68
68
result = await pool . query ( sql ) ;
69
69
await pool . close ( ) ;
70
+ } else if ( databaseType === 'dmdb' ) {
71
+ const connInfo = {
72
+ connectString : `${ host } :${ parseInt ( port , 10 ) } ` ,
73
+ user : user ,
74
+ password : password ,
75
+ loginEncrypt : false ,
76
+ ignoreCase : true
77
+ }
78
+ const connection = await dmdb . getConnection ( connInfo )
79
+ result = await connection . execute ( sql ) ;
80
+ await connection . close ( ) ;
70
81
}
71
82
return {
72
83
result
Original file line number Diff line number Diff line change 46
46
{
47
47
"label" : " Microsoft SQL Server" ,
48
48
"value" : " Microsoft SQL Server"
49
+ },
50
+ {
51
+ "label" : " dmdb" ,
52
+ "value" : " dmdb"
49
53
}
50
54
],
51
55
"required" : true
Original file line number Diff line number Diff line change @@ -63,4 +63,6 @@ CHECK_INTERNAL_IP=false
63
63
# # 日志来源ID前缀
64
64
# CHAT_LOG_SOURCE_ID_PREFIX=fastgpt-
65
65
# 自定义跨域,不配置时,默认都允许跨域(逗号分割)
66
- ALLOWED_ORIGINS=
66
+ ALLOWED_ORIGINS=
67
+ # 允许使用旧版加密算法 (达梦数据库连接时需要)
68
+ NODE_OPTIONS=--openssl-legacy-provider
You can’t perform that action at this time.
0 commit comments