|
|
@ -1,4 +1,10 @@ |
|
|
|
import { DATA_BASE_TYPES, DATA_BASE_TYPES_OTHER, DESIGN_DRIVER_TYPE, OTHER_JDBC } from '@constants/constant'; |
|
|
|
import { |
|
|
|
|
|
|
|
DATA_BASE_TYPES, |
|
|
|
|
|
|
|
DATA_BASE_TYPES_OTHER, |
|
|
|
|
|
|
|
DESIGN_DRIVER_TYPE, |
|
|
|
|
|
|
|
OTHER_JDBC, |
|
|
|
|
|
|
|
DATABASE_TYPE, |
|
|
|
|
|
|
|
} from '@constants/constant'; |
|
|
|
import { DatabaseType } from './app.typings'; |
|
|
|
import { DatabaseType } from './app.typings'; |
|
|
|
import { Connection } from './crud/crud.typings'; |
|
|
|
import { Connection } from './crud/crud.typings'; |
|
|
|
export function getAllDatabaseTypes(): DatabaseType[] { |
|
|
|
export function getAllDatabaseTypes(): DatabaseType[] { |
|
|
@ -75,7 +81,7 @@ export function splitUrl(host: string, port: string, catalog: string, database: |
|
|
|
.replace(':INFORMIXSERVER={server}', ''); |
|
|
|
.replace(':INFORMIXSERVER={server}', ''); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (databaseType === 'starrocks') { |
|
|
|
if (databaseType === DATABASE_TYPE.STAR_ROCKS) { |
|
|
|
let databaseStr = ''; |
|
|
|
let databaseStr = ''; |
|
|
|
if (!catalog || !database) { |
|
|
|
if (!catalog || !database) { |
|
|
|
databaseStr = catalog + database; |
|
|
|
databaseStr = catalog + database; |
|
|
@ -86,6 +92,12 @@ export function splitUrl(host: string, port: string, catalog: string, database: |
|
|
|
.replace('default_catalog.database', databaseStr); |
|
|
|
.replace('default_catalog.database', databaseStr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (databaseType === DATABASE_TYPE.SAP_HANA) { |
|
|
|
|
|
|
|
return baseUrl.replace('hostname', host) |
|
|
|
|
|
|
|
.replace('port', port || '') |
|
|
|
|
|
|
|
.replace('=database', `=${database}`); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return baseUrl.replace('hostname', host).replace(':port', port ? `:${port}` : '') |
|
|
|
return baseUrl.replace('hostname', host).replace(':port', port ? `:${port}` : '') |
|
|
|
.replace('/database', `/${database}`) |
|
|
|
.replace('/database', `/${database}`) |
|
|
|
.replace(':database', `:${database}`) |
|
|
|
.replace(':database', `:${database}`) |
|
|
|