|
|
@ -15,7 +15,7 @@ BI.provider('dec.connection.provider.datebase', function() { |
|
|
|
urlInfo: oracleUlr[10], |
|
|
|
urlInfo: oracleUlr[10], |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const greenplumUrl = url.match(/^jdbc:(pivotal:greenplum):(thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;)([^]+)(.*)/i); |
|
|
|
const greenplumUrl = url.match(/^jdbc:(pivotal:greenplum):(thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;)([^]+)(.*)/i); |
|
|
|
if (greenplumUrl) { |
|
|
|
if (greenplumUrl) { |
|
|
|
return { |
|
|
|
return { |
|
|
@ -25,7 +25,7 @@ BI.provider('dec.connection.provider.datebase', function() { |
|
|
|
urlInfo: greenplumUrl[9], |
|
|
|
urlInfo: greenplumUrl[9], |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
const result = url.match(/^jdbc:(mysql|sqlserver|db2|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql|clickhouse):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;DatabaseName=)?([^]+)?(.*)/i); |
|
|
|
const result = url.match(/^jdbc:(mysql|sqlserver|db2|dm|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql|clickhouse):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;DatabaseName=)?([^]+)?(.*)/i); |
|
|
|
if (result) { |
|
|
|
if (result) { |
|
|
|
return { |
|
|
|
return { |
|
|
|
host: result[5], |
|
|
|
host: result[5], |
|
|
@ -34,13 +34,13 @@ BI.provider('dec.connection.provider.datebase', function() { |
|
|
|
urlInfo: result[10], |
|
|
|
urlInfo: result[10], |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 处理oracle的RAC方式
|
|
|
|
// 处理oracle的RAC方式
|
|
|
|
if (/^jdbc:oracle:thin:([0-9a-zA-Z/]*)?@\(DESCRIPTION/i.test(url)) { |
|
|
|
if (/^jdbc:oracle:thin:([0-9a-zA-Z/]*)?@\(DESCRIPTION/i.test(url)) { |
|
|
|
const host = url.match(/\(HOST\s*=\s*([0-9a-zA-Z_\\.-]+)\)/i); |
|
|
|
const host = url.match(/\(HOST\s*=\s*([0-9a-zA-Z_\\.-]+)\)/i); |
|
|
|
const port = url.match(/\(PORT\s*=\s*([0-9]+)\)/i); |
|
|
|
const port = url.match(/\(PORT\s*=\s*([0-9]+)\)/i); |
|
|
|
const databaseName = url.match(/\(SERVICE_NAME\s*=\s*([\s0-9a-zA-Z_\\.]+)\)/i); |
|
|
|
const databaseName = url.match(/\(SERVICE_NAME\s*=\s*([\s0-9a-zA-Z_\\.]+)\)/i); |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
host: host ? host[1] : '', |
|
|
|
host: host ? host[1] : '', |
|
|
|
port: port && port[1] !== 'port' ? port[1] : '', |
|
|
|
port: port && port[1] !== 'port' ? port[1] : '', |
|
|
@ -48,7 +48,7 @@ BI.provider('dec.connection.provider.datebase', function() { |
|
|
|
urlInfo: '', |
|
|
|
urlInfo: '', |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
host: '', |
|
|
|
host: '', |
|
|
|
port: '', |
|
|
|
port: '', |
|
|
@ -60,10 +60,10 @@ BI.provider('dec.connection.provider.datebase', function() { |
|
|
|
this.registerDatabaseType = (config: any) => { |
|
|
|
this.registerDatabaseType = (config: any) => { |
|
|
|
BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, config)); |
|
|
|
BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, config)); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.registerJdbcDatabase = (config: any, resolve?: Function) => { |
|
|
|
this.registerJdbcDatabase = (config: any, resolve?: Function) => { |
|
|
|
BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, { ...config, type: 'jdbc' })); |
|
|
|
BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, { ...config, type: 'jdbc' })); |
|
|
|
|
|
|
|
|
|
|
|
BI.isFunction(resolve) && (this.resolves[config.databaseType] = resolve); |
|
|
|
BI.isFunction(resolve) && (this.resolves[config.databaseType] = resolve); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|