UNPKG

@finos/legend-graph

Version:
249 lines 7.27 kB
/** * Copyright (c) 2020-present, Goldman Sachs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { hashArray } from '@finos/legend-shared'; import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js'; export class DatasourceSpecification { } export class StaticDatasourceSpecification extends DatasourceSpecification { host; port; databaseName; constructor(host, port, databaseName) { super(); this.host = host; this.port = port; this.databaseName = databaseName; } get hashCode() { return hashArray([ CORE_HASH_STRUCTURE.STATIC_DATASOURCE_SPECIFICATION, this.host, this.port.toString(), this.databaseName, ]); } } export class DatabricksDatasourceSpecification extends DatasourceSpecification { hostname; port; protocol; httpPath; constructor(hostname, port, protocol, httpPath) { super(); this.hostname = hostname; this.port = port; this.protocol = protocol; this.httpPath = httpPath; } get hashCode() { return hashArray([ CORE_HASH_STRUCTURE.DATABRICKS_DATASOURCE_SPECIFICATION, this.hostname, this.port, this.protocol, this.httpPath, ]); } } export class EmbeddedH2DatasourceSpecification extends DatasourceSpecification { databaseName; directory; autoServerMode; constructor(databaseName, directory, autoServerMode) { super(); this.databaseName = databaseName; this.directory = directory; this.autoServerMode = autoServerMode; } get hashCode() { return hashArray([ CORE_HASH_STRUCTURE.EMBEDDED_H2_DATASOURCE_SPECIFICATION, this.databaseName, this.directory, this.autoServerMode.toString(), ]); } } export class LocalH2DatasourceSpecification extends DatasourceSpecification { testDataSetupCsv; testDataSetupSqls = []; get hashCode() { return hashArray([ CORE_HASH_STRUCTURE.LOCAL_H2_DATASOURCE_SPECIFICATION, this.testDataSetupCsv ?? '', hashArray(this.testDataSetupSqls), ]); } } export class SnowflakeDatasourceSpecification extends DatasourceSpecification { accountName; region; warehouseName; databaseName; cloudType; quotedIdentifiersIgnoreCase; proxyHost; proxyPort; nonProxyHosts; organization; accountType; role; enableQueryTags; tempTableDb; tempTableSchema; constructor(accountName, region, warehouseName, databaseName) { super(); this.region = region; this.warehouseName = warehouseName; this.databaseName = databaseName; this.accountName = accountName; } get hashCode() { return hashArray([ CORE_HASH_STRUCTURE.SNOWFLAKE_DATASOURCE_SPECIFICATION, this.accountName, this.region, this.warehouseName, this.databaseName, this.cloudType ?? '', this.proxyHost ?? '', this.proxyPort ?? '', this.nonProxyHosts ?? '', this.organization ?? '', this.accountType ?? '', this.role ?? '', this.quotedIdentifiersIgnoreCase?.toString() ?? '', this.enableQueryTags?.toString() ?? '', this.tempTableDb ?? '', this.tempTableSchema ?? '', ]); } } export class RedshiftDatasourceSpecification extends DatasourceSpecification { clusterID; databaseName; host; port; region; endpointURL; constructor(databaseName, endpointURL, port, host, clusterID, region) { super(); this.clusterID = clusterID; this.region = region; this.host = host; this.databaseName = databaseName; this.endpointURL = endpointURL; this.port = port; } get hashCode() { return hashArray([ CORE_HASH_STRUCTURE.REDSHIFT_DATASOURCE_SPECIFICATION, this.databaseName, this.endpointURL, this.port.toString(), this.clusterID, this.host, this.region, ]); } } export class BigQueryDatasourceSpecification extends DatasourceSpecification { projectId; defaultDataset; proxyHost; proxyPort; constructor(projectId, defaultDataset) { super(); this.projectId = projectId; this.defaultDataset = defaultDataset; } get hashCode() { return hashArray([ CORE_HASH_STRUCTURE.BIGQUERY_DATASOURCE_SPECIFICATION, this.projectId, this.defaultDataset, this.proxyHost ?? '', this.proxyPort ?? '', ]); } } export class SpannerDatasourceSpecification extends DatasourceSpecification { projectId; instanceId; databaseId; proxyHost; proxyPort; constructor(projectId, instanceId, databaseId, proxyHost, proxyPort) { super(); this.projectId = projectId; this.instanceId = instanceId; this.databaseId = databaseId; this.proxyHost = proxyHost; this.proxyPort = proxyPort; } get hashCode() { return hashArray([ CORE_HASH_STRUCTURE.SPANNER_DATASOURCE_SPECIFICATION, this.projectId, this.instanceId, this.databaseId, this.proxyHost ?? '', this.proxyPort ?? '', ]); } } export class TrinoSslSpecification { ssl; trustStorePathVaultReference; trustStorePasswordVaultReference; constructor(ssl) { this.ssl = ssl; } get hashCode() { return hashArray([ CORE_HASH_STRUCTURE.TRINO_SSL_SPECIFICATION, this.ssl.toString(), this.trustStorePathVaultReference ?? '', this.trustStorePasswordVaultReference ?? '', ]); } } export class TrinoDatasourceSpecification extends DatasourceSpecification { host; port; sslSpecification; catalog; schema; clientTags; constructor(host, port, sslSpecification) { super(); this.host = host; this.port = port; this.sslSpecification = sslSpecification; } get hashCode() { return hashArray([ CORE_HASH_STRUCTURE.TRINO_DATASOURCE_SPECIFICATION, this.host, this.port.toString(), this.sslSpecification, this.catalog ?? '', this.schema ?? '', this.clientTags ?? '', ]); } } //# sourceMappingURL=DatasourceSpecification.js.map