Helper class that resolves PostgreSQL connection and credential parameters, validates them and generates a connection URI.

Implements: IReferenceable, IConfigurable


The PostgresConnectionResolver class allows you to create a PostgresSQL connection and credential parameters resolver that validates these parameters and generates a connection URI.

Important points

  • It is able to process multiple connections to PostgreSQL cluster nodes.

Configuration parameters


  • discovery_key: (optional) key to retrieve the connection from IDiscovery
  • host: host name or IP address
  • port: port number (default: 27017)
  • database: database name
  • uri: resource URI or connection string with all parameters in it


  • store_key: (optional) key to retrieve the credentials from ICredentialStore
  • username: username
  • password: user’s password


  • *:discovery:*:*:1.0 - (optional) IDiscovery services
  • *:credential-store:*:*:1.0 - (optional) credential stores to resolve credentials (ICredentialStore)



The connection resolver

protected _connectionResolver: ConnectionResolver


The credential resolver

protected _credentialResolver: CredentialResolver

Instance methods


Configures component by passing configuration parameters.

public configure(config: ConfigParams): void

  • config: ConfigParams - configuration parameters to be set.


Resolves PostgreSQL config from connection and credential parameters.

public resolve(correlationId: string): Promise<any>

  • correlationId: string - (optional) transaction id used to trace execution through the call chain.
  • returns: Promise<any> - resolved connection config or raised error.


Sets references to dependent components.

public setReferences(references: IReferences): void

  • references: IReferences - references to locate the component dependencies.