View source: R/cdr_pull_db_tbls.R
cdr_pull_db_tbls | R Documentation |
Collect both tables (admin & chg-log) from the DB, join them in a user view, and return all 3 tables in a list
cdr_pull_db_tbls(
conn_pool,
db_tbl_name,
chg_log_suffix = "_DELTAS",
key_field = "UID",
...
)
conn_pool |
connection object (preferably a |
db_tbl_name |
name of your primary table |
chg_log_suffix |
name of your change-log table suffix |
key_field |
column in the primary table that acts as the unique row identifier |
... |
other database pointer params like |
a list with primary (admin), change-log, and end-user view tables as list elements
## Not run:
con <- DBI::dbConnect(
drv = RPostgres::Postgres(),
dbname = "test",
host = "localhost",
user = Sys.getenv('postgres_username'),
password = Sys.getenv('postgres_password')
)
as_of <- lubridate::now()-lubridate::years(1)
DBI::dbListTables(con)
DBI::dbListObjects(con)
# both_tbls <- cdr_pull_db_tbls(con, db_tbl_name = 'iris', key_field = 'UID', schema = "test")
DBI::dbDisconnect(con)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.