Removes a column in place with ALTER TABLE ... DROP COLUMN. This is a
metadata-only change: the column disappears from the current schema, but
earlier snapshots still contain it and remain queryable through time
travel.
See also
add_table_column(), rename_table_column(),
get_ducklake_table_version() to read snapshots that still have the
column
Other schema evolution:
add_table_column(),
rename_ducklake_table(),
rename_table_column(),
set_column_not_null(),
set_column_type()
Examples
lake_dir <- tempfile("dropcol_lake_")
dir.create(lake_dir)
attach_ducklake("dropcol_lake", lake_path = lake_dir)
create_table(mtcars, "cars")
drop_table_column("cars", "carb")
#> Dropped column "carb" from "cars". Earlier snapshots still contain it.
detach_ducklake("dropcol_lake", shutdown = TRUE)
unlink(lake_dir, recursive = TRUE)
