
Verify that required Postgres tables exist in a connection
Source:R/lnk_inputs_verify.R
lnk_inputs_verify.RdFail-loud precondition check used by pipeline phases that assume their
input tables are already loaded (typically by a separate snapshot
script). Lists every missing <schema>.<table> in the error message
so the caller knows exactly what to load before re-running.
Value
invisible(NULL) on success. stop()s with a list of missing
tables on failure.
Details
Generic — not specific to any pipeline phase. Likely belongs in a
future pac package once that's scaffolded; ships in link for now.
Queries information_schema.tables once per call, parameterised with
the parsed (schema, table) pairs — single round-trip regardless of
how many tables are in required.
Examples
if (FALSE) { # \dontrun{
conn <- lnk_db_conn()
lnk_inputs_verify(conn, c(
"whse_fish.pscis_assessment_svw",
"cabd.dams",
"working_adms.modelled_stream_crossings"
))
} # }