However, in `sqlx` once you create a pool you need to pass the connection string (which includes the credentials) and you can't change it afterwards.
The pool will create one or more connections with those credentials.
## Workaround
This crate implements a wrapper struct around a reference counted Pool smart pointer. This wrapper can then be updated using internal mutability (mutex protected) whenever the main binary detects a credentials refresh. Every subsequent use of the pool will use the new underlying pool.
This workaround has been designed to solve the problem of updating credentials, but it happens to work if you want to point your pool to an entirely different database as well.
If the credentials refresh happen before the existing credentials are invalidated, references to the previous pool can still be used for some time.
If the credentials refresh contextually invalidates the existing credentials, the process will experience connection errors if they used the pool before it has been updated (and if they cloned the `Arc` before the `update` method has been called).