|
|
|
@ -6,7 +6,7 @@ BI.provider('dec.connection.provider.datebase', function () {
|
|
|
|
|
|
|
|
|
|
function starRocksResolve(url: string) { |
|
|
|
|
// 处理starRocks数据连接常规模式
|
|
|
|
|
const result = url.match(/^jdbc:mysql:\/\/([0-9a-zA-Z_\\.-]+):([0-9a-zA-Z_\\.-]+)\/([0-9a-zA-Z_\\.-]+)\.([^]+)(.*)/i); |
|
|
|
|
let result = url.match(/^jdbc:mysql:\/\/([0-9a-zA-Z_\\.-]+):([0-9a-zA-Z_\\.-]+)\/([0-9a-zA-Z_\\.-]+)\.([^]+)(.*)/i); |
|
|
|
|
if (result) { |
|
|
|
|
return { |
|
|
|
|
host: result[1], |
|
|
|
@ -15,9 +15,21 @@ BI.provider('dec.connection.provider.datebase', function () {
|
|
|
|
|
databaseName: result[4], |
|
|
|
|
urlInfo: result[0], |
|
|
|
|
}; |
|
|
|
|
} else { |
|
|
|
|
// 兼容老数据库里面没有catalog的情况
|
|
|
|
|
result = url.match(/^jdbc:mysql:\/\/([0-9a-zA-Z_\\.-]+):([0-9a-zA-Z_\\.-]+)\/([^]+)(.*)/i); |
|
|
|
|
if (result) { |
|
|
|
|
return { |
|
|
|
|
host: result[1], |
|
|
|
|
port: result[2] === 'port' ? '' : result[2], |
|
|
|
|
catalog: '', |
|
|
|
|
databaseName: result[3], |
|
|
|
|
urlInfo: result[0], |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 处理starRocks数据连接负载均衡模式
|
|
|
|
|
const loadBalance = url.match(/^jdbc:mysql:loadbalance:\/\/[^/]+\/([^/]+)\.([^/]+)/i); |
|
|
|
|
let loadBalance = url.match(/^jdbc:mysql:loadbalance:\/\/[^/]+\/([^/]+)\.([^/]+)/i); |
|
|
|
|
if (loadBalance) { |
|
|
|
|
return { |
|
|
|
|
host: '', |
|
|
|
@ -26,6 +38,18 @@ BI.provider('dec.connection.provider.datebase', function () {
|
|
|
|
|
databaseName: loadBalance[2], |
|
|
|
|
urlInfo: loadBalance[0], |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// 兼容老数据库里面没有catalog的情况
|
|
|
|
|
loadBalance = url.match(/^jdbc:mysql:loadbalance:\/\/[^/]+\/([^/]+)([^/]+)/i); |
|
|
|
|
if (loadBalance) { |
|
|
|
|
return { |
|
|
|
|
host: '', |
|
|
|
|
port: '', |
|
|
|
|
catalog: '', |
|
|
|
|
databaseName: loadBalance[1], |
|
|
|
|
urlInfo: loadBalance[0], |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return { |
|
|
|
|
host: '', |
|
|
|
|