saveCredentials: manage database credentials

View source: R/dbio_credentials.R

saveCredentialsR Documentation

manage database credentials

Description

manage database credentials for for different hosts and for different users within a host.

Usage

saveCredentials(user, pwd, host, db, path)

credentialsExist(host, path)

removeCredentials(path)

getCredentials(user, db, host, path, show = FALSE)

credentialsPath()

Arguments

user

user

pwd

pwd

host

host

db

db

path

when missing s detected by credentialsPath ()

show

default to FALSE

Details

saveCredentials saves the specified credentials to a default location unless you specify a custom path. This information can be used by dbcon and dbq to connect to and query the database. Currently, you can store credentials for different hosts and for different users within a host. removeCredentials removes the credentials file. credentialsExist checks if credentials are saved for a specified host.

Value

credentialsExist,removeCredentials, and saveCredentials return TRUE if successful

Warning

Credentials are stored in plain text in a hidden file in your home directory.

See Also

dbcon,dbq

Examples

saveCredentials(user = 'user_a', pwd = 'pwd_a', host =  '127.0.0.1')
saveCredentials('user_b', 'pass_b', host =  '127.0.0.1')
removeCredentials()


mpio-be/sdb documentation built on Nov. 18, 2022, 12:24 a.m.