in common/lib/aws_client.ts [52:115]
protected constructor(
config: any,
dbType: DatabaseType,
knownDialectsByCode: Map<string, DatabaseDialect>,
parser: ConnectionUrlParser,
driverDialect: DriverDialect
) {
super();
this.config = config;
this._connectionUrlParser = parser;
this.properties = new Map<string, any>(Object.entries(config));
const profileName = WrapperProperties.PROFILE_NAME.get(this.properties);
if (profileName && profileName.length > 0) {
this._configurationProfile = DriverConfigurationProfiles.getProfileConfiguration(profileName);
if (this._configurationProfile) {
const profileProperties = this._configurationProfile.getProperties();
if (profileProperties) {
for (const key of profileProperties.keys()) {
if (this.properties.has(key)) {
// Setting defined by a user has priority over property in configuration profile.
continue;
}
this.properties.set(key, profileProperties.get(key));
}
const connectionProvider = WrapperProperties.CONNECTION_PROVIDER.get(this.properties);
if (!connectionProvider) {
WrapperProperties.CONNECTION_PROVIDER.set(this.properties, this._configurationProfile.getAwsCredentialProvider());
}
const customAwsCredentialProvider = WrapperProperties.CUSTOM_AWS_CREDENTIAL_PROVIDER_HANDLER.get(this.properties);
if (!customAwsCredentialProvider) {
WrapperProperties.CUSTOM_AWS_CREDENTIAL_PROVIDER_HANDLER.set(this.properties, this._configurationProfile.getAwsCredentialProvider());
}
const customDatabaseDialect = WrapperProperties.CUSTOM_DATABASE_DIALECT.get(this.properties);
if (!customDatabaseDialect) {
WrapperProperties.CUSTOM_DATABASE_DIALECT.set(this.properties, this._configurationProfile.getDatabaseDialect());
}
}
} else {
throw new AwsWrapperError(Messages.get("AwsClient.configurationProfileNotFound", profileName));
}
}
this.telemetryFactory = new DefaultTelemetryFactory(this.properties);
const container = new PluginServiceManagerContainer();
this.pluginService = new PluginService(
container,
this,
dbType,
knownDialectsByCode,
this.properties,
this._configurationProfile?.getDriverDialect() ?? driverDialect
);
this.pluginManager = new PluginManager(
container,
this.properties,
new ConnectionProviderManager(new DriverConnectionProvider(), WrapperProperties.CONNECTION_PROVIDER.get(this.properties)),
this.telemetryFactory
);
}