Skip to main content

text_to_json

Function text_to_json 

Source
pub fn text_to_json(type_oid: u32, text: &str) -> Result<Value, FaucetError>
Expand description

Decode a text-encoded value with the given column type OID into JSON.

Unknown OIDs and decode failures both fall back to wrapping the raw text in a JSON string — this is the safest default for a generic CDC connector. We never panic on bad data; the only way this returns Err is if a structurally promised invariant is violated (e.g. OID_BYTEA text that doesn’t start with \x).