Builds a raw snapshot map from a live connection (or a DBA-returned file). Session is read-only with a short statement_timeout — defense in depth, not the privacy mechanism (that is the Queries allowlist).
CRDB row-count honesty: crdb_internal.table_row_statistics.estimated_row_count
reads a literal 0 (not NULL) for a table with no propagated statistics
yet — see crdb_row_counts/2 and Queries's moduledoc note for the
full reasoning. A 0 is mapped to nil here, never forwarded as a real
row count, so Cerbero.Catalog.scale/2 reads it as unknown (unbounded),
never a fabricated zero.
Summary
Functions
A psql script: each query wrapped so output is JSON-lines per section.
Works against both engines — CRDB speaks pgwire and supports
COPY (SELECT row_to_json(...)) TO STDOUT (verified on v25.1), so the
same psql mechanism serves the DBA path there with the CRDB-branched
section list.
Rebuild a raw snapshot map from the DBA-returned psql output.
Functions
A psql script: each query wrapped so output is JSON-lines per section.
Works against both engines — CRDB speaks pgwire and supports
COPY (SELECT row_to_json(...)) TO STDOUT (verified on v25.1), so the
same psql mechanism serves the DBA path there with the CRDB-branched
section list.
Rebuild a raw snapshot map from the DBA-returned psql output.