View source: R/cdr_reconstruct_past_tbl.R
cdr_reconstruct_past_tbl | R Documentation |
Build the admin table as it was at a point in the past
cdr_reconstruct_past_tbl(
as_of = lubridate::now() - lubridate::weeks(x = 4),
conn_pool,
db_tbl_name,
chg_log_suffix = "_DELTAS",
key_field = "UID",
...
)
as_of |
datetime object in the past, e.g. lubridate::now()-lubridate::weeks(4) |
conn_pool |
pool or DBI connection |
db_tbl_name |
primary table name |
chg_log_suffix |
your table name extension specifying the corresponding change-log table, e.g. '_deltas' |
key_field |
column in the primary table that acts as the unique row identifier |
... |
other connection parameters like |
list with primary and change-log tables reconstructed as they were at a time in the past
## Not run:
conn_pool <- pool::dbPool(
DBI::dbConnect( drv = RPostgreSQL::PostgreSQL(),
dbname = "test",
host = "localhost",
port = "5432",
user = Sys.getenv('postgres_username'),
password = Sys.getenv('postgres_password'))
)
cdr_reconstruct_past_tbl(conn_pool = conn_pool, db_tbl_name = 'mtcars', schema = "test")
cdr_reconstruct_past_tbl(conn_pool = conn_pool, db_tbl_name = 'mtcars', schema = "test")
pool::poolClose(conn_pool)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.