diff --git a/postgres-types/src/lib.rs b/postgres-types/src/lib.rs index 6f72a733..eca2a78c 100644 --- a/postgres-types/src/lib.rs +++ b/postgres-types/src/lib.rs @@ -915,6 +915,18 @@ impl<'a> ToSql for &'a [u8] { to_sql_checked!(); } +#[cfg(feature = "array-impls")] +impl ToSql for [u8; N] { + fn to_sql(&self, _: &Type, w: &mut BytesMut) -> Result> { + types::bytea_to_sql(&self[..], w); + Ok(IsNull::No) + } + + accepts!(BYTEA); + + to_sql_checked!(); +} + #[cfg(feature = "array-impls")] impl ToSql for [T; N] { fn to_sql(&self, ty: &Type, w: &mut BytesMut) -> Result> {