feat: support [u8; N] as BYTEA
This commit is contained in:
parent
0984ab1c58
commit
9daf8b1e5d
@ -915,6 +915,18 @@ impl<'a> ToSql for &'a [u8] {
|
||||
to_sql_checked!();
|
||||
}
|
||||
|
||||
#[cfg(feature = "array-impls")]
|
||||
impl<const N: usize> ToSql for [u8; N] {
|
||||
fn to_sql(&self, _: &Type, w: &mut BytesMut) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
|
||||
types::bytea_to_sql(&self[..], w);
|
||||
Ok(IsNull::No)
|
||||
}
|
||||
|
||||
accepts!(BYTEA);
|
||||
|
||||
to_sql_checked!();
|
||||
}
|
||||
|
||||
#[cfg(feature = "array-impls")]
|
||||
impl<T: ToSql, const N: usize> ToSql for [T; N] {
|
||||
fn to_sql(&self, ty: &Type, w: &mut BytesMut) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
|
||||
|
Loading…
Reference in New Issue
Block a user