Skip to content

connectionString could be of type object #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 5, 2025
Merged

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