Answers "which config produced this network, and when" without
hand-written SQL. One row per lnk_pipeline_run() call; by default only
the most recent run per watershed group.
Usage
lnk_log_read(
conn,
cfg,
aoi = NULL,
latest = TRUE,
run_uid = NULL,
phase = c("model", "recompute")
)Arguments
- conn
DBI connection to the pipeline database.
- cfg
An
lnk_configobject — supplies the persist schema.- aoi
Optional watershed group code to filter to.
- latest
Logical. When
TRUE(default), return only the newest run per watershed group.FALSEreturns the full history. Ignored whenrun_uidis supplied — see below.- run_uid
Optional dispatch identifier (link#262). One dispatch of
data-raw/study_area_run.shstamps the samerun_uidon every host and every watershed group, so this is what answers "everything from that run" without a time window. Supplying it forceslatest = FALSE: the question is "every row of this run", andDISTINCT ONwould silently drop a WSG that was re-run within the same dispatch.- phase
Which log to read.
"model"(default) reads<schema>.log, one row perlnk_pipeline_run()call."recompute"reads<schema>.log_recompute, one row perwsg_recompute_one.Rinvocation — the post-consolidate pass that rewritesstreams_accessandstreams_mapping_code, which is the output that ships.
Details
A watershed group present in <persist_schema>.streams but absent here was
modelled before provenance logging existed (link#127) — absence means
pre-provenance vintage, not an error. Rows are never backfilled, because
the config and code state that produced them is not recoverable and a
synthetic row would be fabricated provenance.
Examples
if (FALSE) { # \dontrun{
conn <- lnk_db_conn()
cfg <- lnk_config("default")
# What produced the current PINE network?
lnk_log_read(conn, cfg, aoi = "PINE")
# Every run, newest first.
lnk_log_read(conn, cfg, latest = FALSE)
# Everything from one dispatch, across every host — no time window.
lnk_log_read(conn, cfg, run_uid = "20260901T184455-3f9ac1")
# Was each of those WSGs also recomputed?
lnk_log_read(conn, cfg, run_uid = "20260901T184455-3f9ac1",
phase = "recompute")
} # }
