This is meant to be used with phs_db_connection()
, it can only be used
interactively i.e. not in targets or in a workbench job.
With the default options it will go through the steps to set up a keyring
which can be used to supply passwords to odbc::dbConnect()
(or others) in a
secure and seamless way.
Create an .Renviron file in the project and add a password (for the keyring) to it.
Create a keyring with the password - Since we have saved the password as an environment variable it can be picked unlocked and used automatically.
Add the database password to the keyring.
Usage
setup_keyring(
keyring = "createslf",
key = "db_password",
keyring_exists = FALSE,
key_exists = FALSE,
env_var_pass_exists = FALSE
)