Skip to content

Simple R wrapper that supports upserting an R dataframe to a target SQL server

Notifications You must be signed in to change notification settings

HenrikVarmer/upsertR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

upsertR

upsertR is a simple R wrapper that supports upserting an R dataframe to a target SQL server. The package relies on the DBI package for handling connections and tables.

Installing upsertR

Install the package directly from github with devtools. Run the first line if you do not currently have devtools installed.

# install.packages('devtools') 
devtools::install_github('HenrikVarmer/upsertR')

Functions

There is only one core function in upsertR: upsert(), which lets you upsert a dataframe to a target SQL server. The below example will upsert data df to SQL server connection con to target table ods.events.

upsert(connection = con,    # SQL server connection string
       dataframe  = df,     # input dataframe
       schema     = ods,    # Target schema name on SQL server
       table      = events, # Target table name on SQL server
       delete     = TRUE)   # specifies whether to delete old ID's not present in input DF. TRUE deletes

About

Simple R wrapper that supports upserting an R dataframe to a target SQL server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages