Skip to contents

Add or replace a table in a DuckDB instance with the ability to add a comment for a description of the table. This wraps duckdb::dbWriteTable and adds the comment via dbExecute.

Usage

write_duckdb(
  con,
  table,
  table_name,
  comment = NULL,
  overwrite = TRUE,
  ...,
  quiet = FALSE
)

Arguments

con

DuckDB connection. Default is the in-memory database.

table

The table to add to the database. A data.frame (or coercible to data.frame).

table_name

A string to be the name of the table in the database.

comment

A string or pasted vector of strings to be the comment on the table.

overwrite

Whether to overwrite the table in the database if it already exists.

...

Other parameters passed on to duckdb::dbWriteTable or DBI::dbWriteTable.

quiet

By default this will output confirmation of success. Set this argument to TRUE to silence those messages.

Value

Invisibly returns table.