update_nhl_database: Update the existing tables

Description Usage Arguments

View source: R/update-nhl-db.R

Description

We are going to try to use the dbx package to do an upsert. We can grab all the data we need for the last three days (assuming any gameIDs exist in that time period, otherwise exit gracefully) pull all the data in, and upsert into the appropriate tables. This way, data in the last three days will be updated, and new data will be added.

we can rely upon a staging process where we get the GAMEIDs that have completed since the last time we ran, OR Just go back three days from today, get all the gameIDs that could have happened, run those, and upsert. No need to bother seeing what is or isn't "done."

Usage

1
update_nhl_database(look_back_days = 3, conn = connect_to_db())

Arguments

look_back_days

The number of days to look backwards for updating (Default = 3)

conn

A database connection (one is created if not provided)


anthonyshook/nhldata documentation built on Feb. 22, 2021, 3:51 a.m.