mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 06:24:16 +00:00
Implement PgHasArrayType for all references (#2869)
This commit is contained in:
parent
0d0dddf1d0
commit
b607251fc4
2 changed files with 13 additions and 6 deletions
|
@ -55,6 +55,19 @@ pub trait PgHasArrayType {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> PgHasArrayType for &T
|
||||
where
|
||||
T: PgHasArrayType,
|
||||
{
|
||||
fn array_type_info() -> PgTypeInfo {
|
||||
T::array_type_info()
|
||||
}
|
||||
|
||||
fn array_compatible(ty: &PgTypeInfo) -> bool {
|
||||
T::array_compatible(ty)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> PgHasArrayType for Option<T>
|
||||
where
|
||||
T: PgHasArrayType,
|
||||
|
|
|
@ -16,12 +16,6 @@ impl PgHasArrayType for &'_ [u8] {
|
|||
}
|
||||
}
|
||||
|
||||
impl<const N: usize> PgHasArrayType for &'_ [u8; N] {
|
||||
fn array_type_info() -> PgTypeInfo {
|
||||
PgTypeInfo::BYTEA_ARRAY
|
||||
}
|
||||
}
|
||||
|
||||
impl PgHasArrayType for Box<[u8]> {
|
||||
fn array_type_info() -> PgTypeInfo {
|
||||
<[&[u8]] as Type<Postgres>>::type_info()
|
||||
|
|
Loading…
Reference in a new issue