Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
54ef74ff
提交
54ef74ff
authored
10月 25, 2021
作者:
taojinlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 支持mongodb
上级
b2606600
全部展开
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
52 行增加
和
8 行删除
+52
-8
DatasourceTypes.java
...ava/io/dataease/datasource/constants/DatasourceTypes.java
+1
-1
JdbcProvider.java
...in/java/io/dataease/datasource/provider/JdbcProvider.java
+0
-6
ProviderFactory.java
...java/io/dataease/datasource/provider/ProviderFactory.java
+2
-0
MongoConstants.java
...ain/java/io/dataease/provider/mongodb/MongoConstants.java
+44
-0
MongoQueryProvider.java
...java/io/dataease/provider/mongodb/MongoQueryProvider.java
+0
-0
DataSetTableService.java
...java/io/dataease/service/dataset/DataSetTableService.java
+1
-0
mongodb_unityjdbc_full.jar
drivers/mongodb_unityjdbc_full.jar
+0
-0
DsTree.vue
frontend/src/views/system/datasource/DsTree.vue
+2
-0
form.vue
frontend/src/views/system/datasource/form.vue
+2
-1
没有找到文件。
backend/src/main/java/io/dataease/datasource/constants/DatasourceTypes.java
浏览文件 @
54ef74ff
...
...
@@ -9,7 +9,7 @@ public enum DatasourceTypes {
sqlServer
(
"sqlServer"
,
"sqlServer"
,
"com.microsoft.sqlserver.jdbc.SQLServerDriver"
,
"\""
,
"\""
,
"\""
,
"\""
),
de_doris
(
"de_doris"
,
"de_doris"
,
"com.mysql.jdbc.Driver"
,
"`"
,
"`"
,
""
,
""
),
oracle
(
"oracle"
,
"oracle"
,
"oracle.jdbc.driver.OracleDriver"
,
"\""
,
"\""
,
"\""
,
"\""
),
mongo
(
"mongo"
,
"mongodb"
,
"com.mongodb.jdbc.MongoDriver"
,
"`"
,
"`"
,
"
'"
,
"'
"
),
mongo
(
"mongo"
,
"mongodb"
,
"com.mongodb.jdbc.MongoDriver"
,
"`"
,
"`"
,
"
\""
,
"\"
"
),
ck
(
"ch"
,
"ch"
,
"ru.yandex.clickhouse.ClickHouseDriver"
,
"`"
,
"`"
,
"'"
,
"'"
),
es
(
"es"
,
"es"
,
""
,
"\""
,
"\""
,
"\""
,
"\""
);
...
...
backend/src/main/java/io/dataease/datasource/provider/JdbcProvider.java
浏览文件 @
54ef74ff
...
...
@@ -11,11 +11,8 @@ import io.dataease.exception.DataEaseException;
import
io.dataease.i18n.Translator
;
import
io.dataease.provider.QueryProvider
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
java.beans.PropertyVetoException
;
import
java.io.File
;
import
java.io.IOException
;
...
...
@@ -29,9 +26,6 @@ public class JdbcProvider extends DatasourceProvider {
public
ExtendedJdbcClassLoader
extendedJdbcClassLoader
;
static
private
String
FILE_PATH
=
"/opt/dataease/drivers"
;
// @Resource
// private WallFilter wallFilter;
@PostConstruct
public
void
init
()
throws
Exception
{
ClassLoader
classLoader
=
Thread
.
currentThread
().
getContextClassLoader
();
...
...
backend/src/main/java/io/dataease/datasource/provider/ProviderFactory.java
浏览文件 @
54ef74ff
...
...
@@ -48,6 +48,8 @@ public class ProviderFactory implements ApplicationContextAware {
return
context
.
getBean
(
"esQuery"
,
QueryProvider
.
class
);
case
ck:
return
context
.
getBean
(
"ckQuery"
,
QueryProvider
.
class
);
case
mongo:
return
context
.
getBean
(
"mongoQuery"
,
QueryProvider
.
class
);
default
:
return
context
.
getBean
(
"mysqlQuery"
,
QueryProvider
.
class
);
}
...
...
backend/src/main/java/io/dataease/provider/mongodb/MongoConstants.java
0 → 100644
浏览文件 @
54ef74ff
package
io
.
dataease
.
provider
.
mongodb
;
import
io.dataease.provider.SQLConstants
;
import
static
io
.
dataease
.
datasource
.
constants
.
DatasourceTypes
.
mongo
;
import
static
io
.
dataease
.
datasource
.
constants
.
DatasourceTypes
.
oracle
;
/**
* @Author gin
* @Date 2021/7/8 7:22 下午
*/
public
class
MongoConstants
extends
SQLConstants
{
public
static
final
String
KEYWORD_TABLE
=
"%s"
;
public
static
final
String
KEYWORD_FIX
=
"%s."
+
mongo
.
getKeywordPrefix
()
+
"%s"
+
mongo
.
getKeywordSuffix
();
public
static
final
String
ALIAS_FIX
=
mongo
.
getAliasPrefix
()
+
"%s"
+
oracle
.
getAliasSuffix
();
public
static
final
String
toInt32
=
"toInt32(%s)"
;
public
static
final
String
toDateTime
=
"toDateTime(%s)"
;
public
static
final
String
toInt64
=
"toInt64(%s)"
;
public
static
final
String
toFloat64
=
"toFloat64(%s)"
;
public
static
final
String
formatDateTime
=
"formatDateTime(%s,'%s')"
;
public
static
final
String
toDecimal
=
"toDecimal64(%s,2)"
;
public
static
final
String
DEFAULT_DATE_FORMAT
=
"%Y-%m-%d %H:%M:%S"
;
public
static
final
String
WHERE_VALUE_NULL
=
"(NULL,'')"
;
public
static
final
String
WHERE_VALUE_VALUE
=
"'%s'"
;
public
static
final
String
AGG_COUNT
=
"COUNT(*)"
;
public
static
final
String
AGG_FIELD
=
"%s(%s)"
;
public
static
final
String
WHERE_BETWEEN
=
"'%s' AND '%s'"
;
public
static
final
String
BRACKETS
=
"(%s)"
;
}
backend/src/main/java/io/dataease/provider/mongodb/MongoQueryProvider.java
0 → 100644
浏览文件 @
54ef74ff
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java
浏览文件 @
54ef74ff
...
...
@@ -1037,6 +1037,7 @@ public class DataSetTableService {
if
(
CollectionUtils
.
isNotEmpty
(
fields
))
{
for
(
int
i
=
0
;
i
<
fields
.
size
();
i
++)
{
TableFiled
filed
=
fields
.
get
(
i
);
System
.
out
.
println
(
new
Gson
().
toJson
(
filed
));
DatasetTableField
datasetTableField
=
DatasetTableField
.
builder
().
build
();
datasetTableField
.
setTableId
(
datasetTable
.
getId
());
datasetTableField
.
setOriginName
(
filed
.
getFieldName
());
...
...
drivers/mongodb_unityjdbc_full.jar
0 → 100644
浏览文件 @
54ef74ff
File added
frontend/src/views/system/datasource/DsTree.vue
浏览文件 @
54ef74ff
...
...
@@ -163,6 +163,8 @@ export default {
return
'MariaDB'
}
else
if
(
type
===
'ds_doris'
)
{
return
'Doris'
}
else
if
(
type
===
'mongo'
)
{
return
'MongoDB'
}
},
...
...
frontend/src/views/system/datasource/form.vue
浏览文件 @
54ef74ff
...
...
@@ -158,7 +158,8 @@ export default {
{
name
:
'es'
,
label
:
'Elasticsearch'
,
type
:
'es'
},
{
name
:
'mariadb'
,
label
:
'MariaDB'
,
type
:
'jdbc'
,
extraParams
:
'characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true'
},
{
name
:
'ds_doris'
,
label
:
'Doris'
,
type
:
'jdbc'
,
extraParams
:
'characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true'
},
{
name
:
'ck'
,
label
:
'ClickHouse'
,
type
:
'jdbc'
,
extraParams
:
''
}
{
name
:
'ck'
,
label
:
'ClickHouse'
,
type
:
'jdbc'
,
extraParams
:
''
},
{
name
:
'mongo'
,
label
:
'MongoDB'
,
type
:
'jdbc'
,
extraParams
:
''
}
],
schemas
:
[],
canEdit
:
false
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论