The `append_layer()` method assumes the data source already has a layer of the same format as the new data. This can work with either spatial or non-spatial data. It use `sf::st_write()` instead of `DBI::dbAppendTable()` in order to handle spatial data.
Arguments
- data
a tibble or data frame to write to the database. The column names must be consistent with those in the target layer.
- dsn
data source name. Typically a path to a geopackage.
- layer
layer name to append.
- id_fields
names of field on which to join the new data. These fields determine whether each row is unique using`dplyr::anti_join()`