pub fn sql_concat<'a>(values: impl Iterator<Item = &'a Self>) -> Result<Self, Error> {
        use std::fmt::Write;

        let mut res = ByteString::default();
        for item in values {
            match item {
                Self::Null => return Ok(Self::Null),
                Self::Number(n) => res.extend_number(n),
                Self::Bytes(b) => res.extend_byte_string(b),
                Self::Timestamp(timestamp, tz) => {
                    write!(res, "{}", tz.from_utc_datetime(timestamp).format(TIMESTAMP_FORMAT)).unwrap();
                }
                Self::Interval(interval) => write!(res, "INTERVAL {} MICROSECOND", interval).unwrap(),
                Self::Array(_) => {
                    return Err(Error::InvalidArguments(
                        "cannot concatenate arrays using || operator".to_owned(),
                    ))
                }
            }
        }
        Ok(Self::Bytes(res))
    }
/// Concatenates multiple values into a string.
Concatenates multiple values into a string.
Concatenates multiple values into a string .
pub fn sql_concat<'a>(values: impl Iterator<Item = &'a Self>) -> Result<Self, Error> {
        use std::fmt::Write;
        let mut res = ByteString::default();
        for item in values {
            match item {
                Self::Null => return Ok(Self::Null),
                Self::Number(n) => res.extend_number(n),
                Self::Bytes(b) => res.extend_byte_string(b),
                Self::Timestamp(timestamp, tz) => {
                    write!(res, "{}", tz.from_utc_datetime(timestamp).format(TIMESTAMP_FORMAT)).unwrap();
                }
                Self::Interval(interval) => write!(res, "INTERVAL {} MICROSECOND", interval).unwrap(),
                Self::Array(_) => {
                    return Err(Error::InvalidArguments(
                        "cannot concatenate arrays using || operator".to_owned(),
                    ))
                }
            }
        }
        Ok(Self::Bytes(res))
    }
pub fn sql_concat < ' a > ( values : impl Iterator < Item = & ' a Self > ) -> Result < Self , Error > { use std :: fmt :: Write ; let mut res = ByteString :: default ( ) ; for item in values { match item { Self :: Null => return Ok ( Self :: Null ) , Self :: Number ( n ) => res . extend_number ( n ) , Self :: Bytes ( b ) => res . extend_byte_string ( b ) , Self :: Timestamp ( timestamp , tz ) => { write ! ( res " " tz from_utc_datetime ( timestamp ) format ( TIMESTAMP_FORMAT ) ) . unwrap ( ) ; } Self :: Interval ( interval ) => write ! ( res " " interval ) . unwrap ( ) , Self :: Array ( _ ) => { return Err ( Error :: InvalidArguments ( " " . to_owned ( ) , ) ) } } } Ok ( Self :: Bytes ( res ) ) }
Concatenates multiple values into a string.
Concatenates multiple values into a string .
values
impl Iterator<Item = &'a Self>
values
impl Iterator<Item = &'a Self>