Skip to main content

parse_postgres_source_details

Function parse_postgres_source_details 

Source
fn parse_postgres_source_details<'a>(a: &'a str) -> Result<Jsonb, EvalError>
Expand description

Extracts postgres source publication details (slot, timeline_id) from a catalog create_sql. Returns:

  • jsonb {"slot": <text>, "timeline_id": <u64 | null>} for CREATE SOURCE ... FROM POSTGRES CONNECTION ... (DETAILS = ...) statements.
  • jsonb null for any other statement.

Errors if the statement fails to parse, is a postgres source without a DETAILS option, or if the DETAILS value can’t be hex- and proto-decoded.