access_postgresql: Access and import PostgreSQL data

Description Usage Arguments Value Author(s) See Also Examples

View source: R/access_postgresql.R

Description

This function should be used to access the remote PostgreSQL data base and import data into the current R session. The function will attempt to open a connection, execute the defined functions and close the database connection.

Usage

1
2
3
4
5
6
7
access_postgresql(
  host,
  username,
  password,
  db_name,
  report_name = c("tb_month", "hcv_month", "hiv_month")
)

Arguments

host

string defining PostgreSQL database host name

username

string to identify database username

password

string to provide access password

db_name

string to identify the name of the database being accessed - e.g. "analytics"

report_name

string defining which report-specific data to extract from PostgreSQL data base

Value

A list of R objects will be returned. The content will be dependent upone the functions defined in import_fun.

Author(s)

Jay Achar

See Also

hisreportr

Examples

1
2
3
4
5
6
7
## Not run: 
access_postgresql(host = "test-postgre-oca.org",
                  username = "user1",
                  password = PG_PWD,
                  report_name = "tb_month")

## End(Not run)

JayAchar/hisreportr documentation built on March 18, 2020, 5:57 a.m.