Skip to content

Commit

Permalink
added functionality to choose database
Browse files Browse the repository at this point in the history
useful when connecting to either AFSC or AKFIN databases
  • Loading branch information
zoyafuso-NOAA committed Mar 1, 2024
1 parent 71c6ef3 commit b8f83e1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/get_connected.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ get_connected <- function(db = "AFSC", check_access = TRUE) {

# check if database name is stored in keyring, if not request user/pwd
if(!(db %in% keyring::key_list()[,1])) {
username <- getPass::getPass(msg = "Enter your AFSC Oracle Database Username: ")
password <- getPass::getPass(msg = "Enter your AFSC Oracle Database Password: ")
username <- getPass::getPass(msg = paste("Enter your", db,
"Oracle Database Username: "))
password <- getPass::getPass(msg = paste("Enter your", db,
"Oracle Database Password: "))
} else {
username <- keyring::key_list(db)$username
password <- keyring::key_get(db, keyring::key_list(db)$username)
Expand Down Expand Up @@ -75,6 +77,6 @@ get_connected <- function(db = "AFSC", check_access = TRUE) {
"\n\nPlease contact [email protected] for access to these tables and then try connecting again.")
)

}
} else(return(channel))
}
}

0 comments on commit b8f83e1

Please sign in to comment.