Insert rows into a database table

db_insert(df, table, db, ...)

Arguments

df

data.frame

table

character vector of an optional schema and table name

db

database object returned by db_connect

...

further parameters passed to dbWriteTable, eg to modify row.names or append (depends on driver)

See also

RMySQL::dbWriteTable, RPostgreSQL::dbReadTable-methods

db_append

Examples

if (FALSE) { options('db_config_path' = system.file('example_db_config.yaml', package = 'dbr')) db_insert(mtcars, 'mtcars', 'sqlite') db_append(mtcars, c('dm', 'mtcars'), 'sqlite') }