Copy local R table to remote data handle.

rq_copy_to(
  db,
  table_name,
  d,
  ...,
  qualifiers = NULL,
  overwrite = FALSE,
  temporary = TRUE,
  rowidcolumn = NULL
)

Arguments

db

database connection handle.

table_name

name of table to create.

d

data.frame to copy to database.

...

force later argument to be by name

qualifiers

optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.

overwrite

logical, if TRUE try to overwrite existing table.

temporary

logical, if TRUE try to mark table as temporary.

rowidcolumn

character, name to land row-ids.

Value

a relop representation of the data

See also

Examples

if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") d <- rq_copy_to(db, 'd', data.frame(AUC = 0.6, R2 = 0.2)) sql <- to_sql(d, db) cat(sql) print(DBI::dbGetQuery(db, "SELECT * FROM d")) DBI::dbDisconnect(db) }
#> SELECT #> `AUC`, #> `R2` #> FROM #> `d` #> AUC R2 #> 1 0.6 0.2