From f4f0a552b6b6ddfe221978cd4478397ae8b47cfa Mon Sep 17 00:00:00 2001 From: dailer Date: Mon, 22 Nov 2021 19:22:55 +0800 Subject: [PATCH] =?UTF-8?q?DEC-21535=20fix:=20=E3=80=90=E8=BF=AD=E4=BB=A3?= =?UTF-8?q?=E3=80=91=E3=80=90=E8=BE=BE=E6=A2=A6=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E9=80=82=E9=85=8D=E3=80=91=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BE=93?= =?UTF-8?q?=E5=85=A5URL=EF=BC=8C=E5=AF=B9=E5=BA=94=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=B8=8D=E5=9B=9E=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/app.provider.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/app.provider.ts b/src/modules/app.provider.ts index af2db61..d36a9f8 100644 --- a/src/modules/app.provider.ts +++ b/src/modules/app.provider.ts @@ -15,7 +15,7 @@ BI.provider('dec.connection.provider.datebase', function() { urlInfo: oracleUlr[10], }; } - + const greenplumUrl = url.match(/^jdbc:(pivotal:greenplum):(thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;)([^]+)(.*)/i); if (greenplumUrl) { return { @@ -25,7 +25,7 @@ BI.provider('dec.connection.provider.datebase', function() { 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) { return { host: result[5], @@ -34,13 +34,13 @@ BI.provider('dec.connection.provider.datebase', function() { urlInfo: result[10], }; } - + // 处理oracle的RAC方式 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 port = url.match(/\(PORT\s*=\s*([0-9]+)\)/i); const databaseName = url.match(/\(SERVICE_NAME\s*=\s*([\s0-9a-zA-Z_\\.]+)\)/i); - + return { host: host ? host[1] : '', port: port && port[1] !== 'port' ? port[1] : '', @@ -48,7 +48,7 @@ BI.provider('dec.connection.provider.datebase', function() { urlInfo: '', }; } - + return { host: '', port: '', @@ -60,10 +60,10 @@ BI.provider('dec.connection.provider.datebase', function() { this.registerDatabaseType = (config: any) => { BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, config)); }; - + this.registerJdbcDatabase = (config: any, resolve?: Function) => { BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, { ...config, type: 'jdbc' })); - + BI.isFunction(resolve) && (this.resolves[config.databaseType] = resolve); };