The goal of rpgconn is to provide a simple interface for connecting to a PostgreSQL database.
The environment variable RPG_CONN_STRING
must be set and
have the format shown below.
<- "user=postgres;password=some_password;host=some_host;port=5432;dbname=postgres"
cs Sys.setenv(RPG_CONN_STRING = cs)
install.packages("rpgconn")
# OR
::install_github("r-data-science/rpgconn") remotes
library(rpgconn)
library(DBI)
#open connection
<- dbc("some_database")
cn
# List tables
dbListTables(cn)
# Close connection
dbd(cn)