Skip to main content

Module postgres

Module postgres 

Source
Expand description

PostgreSQL Source implementation.

Module layout:

  • mod.rs (this file) — PostgresSource struct + connect/TLS path, the transaction-pooler detector, PgTxnGuard, sampling helpers (sample_temp_bytes, pg_sample_checkpoints_req, pg_fetch_work_mem_bytes), introspect_pg_table_for_chunking, the cursor + FETCH export loop (pg_run_export), the Source trait impl, and the catalog-hint resolver that bridges parsed FROM clauses to pg_catalog.
  • [arrow_convert] — the entire row → Arrow RecordBatch pipeline: type mapping (pg_columns_to_schema, rivet_type_for_pg_column), per-cell decoders (INTERVAL, UUID, enum, NUMERIC), and the array builders. Kept in a sibling because it is the largest single-purpose cluster in this driver (~620 LoC) and has zero reverse dependency back into the connection / cursor layer.
  • [from_parse] — pure &str/&[u8] parser that extracts the simple <schema>.<table> literal from a user query so the catalog-hint path can cast it to regclass. Zero postgres-crate dependency, fully unit-tested in isolation.

Structs§

PostgresSource