
Last chance! 50% off unlimited learning
Sale ends in
Copy local R table to remote data handle.
rq_copy_to(db, table_name, d, ..., overwrite = FALSE, temporary = TRUE,
rowidcolumn = NULL)
database connection handle.
name of table to create.
data.frame to copy to database.
force later argument to be by name
logical, if TRUE try to overwrite existing table.
logical, if TRUE try to mark table as temporary.
character, name to land row-ids.
a relop representation of the data
# NOT RUN {
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)
}
# }
Run the code above in your browser using DataLab