Skip to content
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

[Question]. Pass client config when using pool #3086

Open
JSEvgeny opened this issue Oct 31, 2023 · 0 comments
Open

[Question]. Pass client config when using pool #3086

JSEvgeny opened this issue Oct 31, 2023 · 0 comments

Comments

@JSEvgeny
Copy link

Hey there and thank you for you time!

I have a question about using connection pool. The idea is to pass some configuration to all clients inside that pool, specifically idle_in_transaction_session_timeout. But because I'm using Pool, I configure the pool with corresponding settings and not the clients inside the pool.

As a workaround I use a connect event, but is there a better way to achieve this?

pool.on('connect', async (client) => {
      await client
        .query(`SET idle_in_transaction_session_timeout=30000`)
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

No branches or pull requests

1 participant