Create a connection to the Mexer database
db-connections.Rd
The process of creating a connection to the Mexer database is cumbersome. This function provides a way to make connections with little fuss and a single line of code.
Usage
get_db_conn(dbname = "MexerDB", user, host = "mexer.site", port = 6432)
get_mexerdb_conn(user)
get_sandboxdb_conn()
get_scratchmdb_conn()
get_scratchedb_conn()
Arguments
- dbname
The string name of a database at
host
. Default is "MexerDB" forget_mexerdb_conn()
, "SandboxDB" forget_sandboxdb_conn()
, "ScratchMDB" forget_scratchmdb_conn()
, and "ScratchEDB" forget_scratchedb_conn()
.- user
The string username at
host
. Default is "dbcreator" forget_sandboxdb_conn()
,get_scratchmdb_conn()
, andget_scratchedb_conn()
, appropriate for development.- host
The string site of the database. Default is "mexer.site".
- port
The integer port for the connection. Default is
6432
, the port of the connection pooler.
Details
Note, the password for user
must be set
in .pgpass
or a similar file.
The returned connection should be closed by the caller
with DBI::dbDisconnect()
.