Wraps a caller-supplied projection select_sql (which must yield the canonical
obs columns by name — realm, dataset_key, sample_key, grid_key,
cruise_key, latitude, longitude, datetime, depth_min_m, depth_max_m,
taxon_key, life_stage, measurement_type, measurement_value,
measurement_qual, measurement_prec), mints a surrogate obs_id (offset from
the current max so repeated calls stay unique within one connection) and computes
hex_id at H3 resolution res_max. The same helper serves the central Phase-2
materialization (release_database.qmd) and each per-dataset ingest (Phase 3);
release assembly renumbers obs_id globally across the reassembled shards.
Arguments
- con
a DuckDB connection (open via
get_duckdb_con())- select_sql
a SELECT producing the canonical
obscolumns by name- obs_tbl
target table name (
"obs", or"obs_ctd_full"for full CTD)- res_max
finest H3 resolution stored in
hex_id