Skip to main content

decode_copy_format_csv

Function decode_copy_format_csv 

Source
pub fn decode_copy_format_csv(
    data: &[u8],
    column_types: &[Type],
    params: CopyCsvFormatParams<'_>,
) -> Result<Vec<Row>, Error>
Expand description

Decodes one chunk of CSV COPY FROM STDIN data into rows.

The caller cuts the stream into chunks, and must uphold:

  • data does not start with the stream’s BOM. It would decode as data.
  • data does not start between the CR and the LF of a line ending. The LF would decode as a blank line.
  • params.quote is neither CR nor LF. A record that starts with a quoted field would decode as a blank line.