View source: R/update-nhl-db.R
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."
1 | update_nhl_database(look_back_days = 3, conn = connect_to_db())
|
look_back_days |
The number of days to look backwards for updating (Default = 3) |
conn |
A database connection (one is created if not provided) |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.