Skip to content

Conversation

HarshDaryani896
Copy link

Applications can provide the connection string in the following 2 formats:

  1. String
const client = new Client({
  connectionString: 'postgres://username:password@localhost:5432/mydatabase'
});
  1. Object
const client = new Client({
  host: 'localhost',
  port: 5432,
  user: 'username',
  password: 'password',
  database: 'mydatabase'
});

When the connection string is of type object, the driver is not able to create the control connection and we see the following log in the output:
Not able to create control connection to any node due to error str.charAt is not a function

This is because for the control connection, we are setting the connectionString expecting it to be String.
This PR implements the fix for this.

Debug pipeline run:

@HarshDaryani896 HarshDaryani896 merged commit c63d99a into master Feb 5, 2025
@HarshDaryani896 HarshDaryani896 deleted the pool-client branch February 5, 2025 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants