Copy local R table to remote data handle.
rq_copy_to(
db,
table_name,
d,
...,
qualifiers = NULL,
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
optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.
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
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