smart_upload: Upload a list of files to the DB

View source: R/etl_load.R

smart_uploadR Documentation

Upload a list of files to the DB

Description

Upload a list of files to the DB

Usage

smart_upload(obj, src = NULL, tablenames = NULL, ...)

Arguments

obj

An etl object

src

a list of CSV files to upload. If NULL, will return all CSVs in the load directory

tablenames

a list the same length as src of tablenames in the database corresponding to each of the files in src. If NULL, will default to the same name as src, without paths or file extensions.

...

arguments passed to dbWriteTable

Examples

## Not run: 
if (require(RMySQL)) {
  # must have pre-existing database "fec"
  # if not, try
  system("mysql -e 'CREATE DATABASE IF NOT EXISTS fec;'")
  db <- src_mysql_cnf(dbname = "mtcars")
}

## End(Not run)

beanumber/etl documentation built on Oct. 14, 2023, 4:06 a.m.