Skip to contents

Drops a table from the specified database and schema if it exists. Uses `DROP TABLE IF EXISTS` for safety and prints a CLI status report.

Usage

delete_table(.con, database_name, schema_name, table_name, cascade = TRUE)

Arguments

.con

A valid `DBI` connection (DuckDB / MotherDuck).

database_name

Name of the database containing the table.

schema_name

Name of the schema containing the table.

table_name

Name of the table to drop.

cascade

Logical; if `TRUE` (default), drop dependent objects as well using `CASCADE`. If `FALSE`, the drop will fail if there are dependencies.

Value

Invisibly returns `NULL`. Side effect: drops the table and prints CLI status messages.

See also

[DBI::dbExecute()], [delete_schema()], [delete_database()]