smart_upload: Upload a list of files to the DB

Description Usage Arguments Examples

View source: R/etl_load.R

Description

Upload a list of files to the DB

Usage

1
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

1
2
3
4
5
6
7
8
9
## 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)

etl documentation built on Sept. 28, 2017, 1:06 a.m.