-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
What is the recommended approach to dealing with passwords that can change dynamically?
At first, I saw this PR, only to find out it is actually useless for this, as it only invokes the callback once, in the beginning. In my case, the password can change at any point, and the pool connection needs to be updated accordingly.
At first, I tried destroying and then re-creating the pool, but this seemed too radical, and awkward, having to track authentication issues to figure out when to re-create the pool.
Then I tried setting pool.options.password = 'new-password'
whenever I was about to reuse the pool object. But this would only work when a connection object was used. For a connection string, I had to re-generate the string, and set it to pool.options.connectionString
before every use of the pool.
This all looks like a hack. Is there a recommended approach to updating the pool with the new password?