Encodes the given `Row` into bytes based on the given `CopyFormatParams`.
(
params: &CopyFormatParams<'a>,
row: &RowRef,
typ: &SqlRelationType,
out: &mut Vec<u8>,
)
| 477 | |
| 478 | /// Encodes the given `Row` into bytes based on the given `CopyFormatParams`. |
| 479 | pub fn encode_copy_format<'a>( |
| 480 | params: &CopyFormatParams<'a>, |
| 481 | row: &RowRef, |
| 482 | typ: &SqlRelationType, |
| 483 | out: &mut Vec<u8>, |
| 484 | ) -> Result<(), io::Error> { |
| 485 | match params { |
| 486 | CopyFormatParams::Text(params) => encode_copy_row_text(params, row, typ, out), |
| 487 | CopyFormatParams::Csv(params) => encode_copy_row_csv(params, row, typ, out), |
| 488 | CopyFormatParams::Binary => encode_copy_row_binary(row, typ, out), |
| 489 | CopyFormatParams::Parquet => { |
| 490 | // TODO(cf2): Support Parquet over STDIN. |
| 491 | Err(io::Error::new(io::ErrorKind::Unsupported, "parquet format")) |
| 492 | } |
| 493 | } |
| 494 | } |
| 495 | |
| 496 | pub fn encode_copy_format_header<'a>( |
| 497 | params: &CopyFormatParams<'a>, |