Using the RPostgreSQL package, is there a way to connect to a remote PostgreSQL instance other than hardcoding the credentials into the dbConnect
method?
As far as I can tell, this is the only way to do it:
dbConnect(drv, host='some.com', port='5432', dbname='some-db', user='usr', password='secrecy')
Certainly there's a way to use a connection string or something?
Edit: I mean referencing some file (separate from the source code) or environment variable that contains the connection string. Sort of like .pgpass
in my home directory, or DATABASE_URL
on heroku. Just some way to avoid having DB credentials in the source code.