-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added functionality to choose database
useful when connecting to either AFSC or AKFIN databases
- Loading branch information
1 parent
71c6ef3
commit b8f83e1
Showing
1 changed file
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
@@ -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)) | ||
} | ||
} |