Currently, if you have a multi-schema database, you cannot access schema specifically using the
-
DBI::Id functionality.
- https://dbi.r-dbi.org/reference/id
-
table <- DBI::Id(schema = "my_schema", table = "my_cars")
DBI::dbWriteTable(conn, name = table, value = mtcars, overwrite=FALSE, append=TRUE)
- Ideally all of the functions would use DBI::dbQuoteIdentifier to resolve the table object, or use slots
-
DBI::dbQuoteIdentifier(conn, table)
# <SQL> "my_schema"."my_cars"
-
As such when trying to update tables with dbWriteTable in a particular schema and you want to not overwrite, but append, the code will error out because things like dbExistsTable fail to detect the table already exists in the other schema.
Currently, if you have a multi-schema database, you cannot access schema specifically using the
DBI::Id functionality.
As such when trying to update tables with dbWriteTable in a particular schema and you want to not overwrite, but append, the code will error out because things like dbExistsTable fail to detect the table already exists in the other schema.