We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0984ab1 commit 9daf8b1Copy full SHA for 9daf8b1
postgres-types/src/lib.rs
@@ -915,6 +915,18 @@ impl<'a> ToSql for &'a [u8] {
915
to_sql_checked!();
916
}
917
918
+#[cfg(feature = "array-impls")]
919
+impl<const N: usize> ToSql for [u8; N] {
920
+ fn to_sql(&self, _: &Type, w: &mut BytesMut) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
921
+ types::bytea_to_sql(&self[..], w);
922
+ Ok(IsNull::No)
923
+ }
924
+
925
+ accepts!(BYTEA);
926
927
+ to_sql_checked!();
928
+}
929
930
#[cfg(feature = "array-impls")]
931
impl<T: ToSql, const N: usize> ToSql for [T; N] {
932
fn to_sql(&self, ty: &Type, w: &mut BytesMut) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
0 commit comments