Assigns sequential integer IDs to a table based on specified sort order. This ensures reproducibility when appending new data - the same data will always get the same IDs.
Examples
if (FALSE) { # \dontrun{
con <- get_duckdb_con()
# assign site_id sorted by cruise_key and orderocc
assign_sequential_ids(
con = con,
table_name = "site",
id_col = "site_id",
sort_cols = c("cruise_key", "orderocc"))
# assign lookup_id with multi-column sort
assign_sequential_ids(
con = con,
table_name = "lookup",
id_col = "lookup_id",
sort_cols = c("lookup_type", "lookup_num"))
} # }