考虑使用dplyr将数据添加到表中,我看到https://stackoverflow.com/a/26784801/1653571,但文档说db_insert_table()
已被弃用。不能使用dplyr将数据追加到sqlite3 db_write_table()
?db_insert_into()
...
db_create_table() and db_insert_into() have been deprecated in favour of db_write_table().
...
我试图用非弃用db_write_table()
代替,但既没有在append=
选项失败:
require(dplyr)
my_db <- src_sqlite("my_db.sqlite3", create = TRUE) # create src
copy_to(my_db, iris, "my_table", temporary = FALSE) # create table
newdf = iris # create new data
db_write_table(con = my_db$con, table = "my_table", values = newdf) # insert into
# Error: Table `my_table` exists in database, and both overwrite and append are FALSE
db_write_table(con = my_db$con, table = "my_table", values = newdf,append=True) # insert into
# Error: Table `my_table` exists in database, and both overwrite and append are FALSE
如果一个能够与db_write_table()
追加数据?
也https://github.com/tidyverse/dplyr/issues/3120