Adds a column in place with ALTER TABLE ... ADD COLUMN. This is a
metadata-only change: no data files are rewritten, history is preserved,
and earlier snapshots still show the old schema. Compare
replace_table(), which collects the table into R and rewrites it.
Arguments
- table_name
The table to change.
- column_name
Name of the new column.
- type
SQL type for the new column, e.g.
"INTEGER","DECIMAL(10,2)", or"TIMESTAMP WITH TIME ZONE".- default
Optional default value (an R scalar: character, numeric, logical, Date, or POSIXct). In DuckLake the default applies to existing rows as well as future inserts, so the new column appears filled everywhere. Without a default, the column reads
NAfor existing rows.
