Skip to content

Commit

Permalink
Adding PgHasArrayType for &[u8;N] (#2634)
Browse files Browse the repository at this point in the history
* Adding PgHasArrayType for &[u8;N]

* cargo fmt

---------

Co-authored-by: asdf <asdf@ethereum>
  • Loading branch information
snf and asdf committed Jul 24, 2023
1 parent eae9484 commit 7e7dded
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sqlx-postgres/src/types/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ impl PgHasArrayType for &'_ [u8] {
}
}

impl<const N: usize> PgHasArrayType for &'_ [u8; N] {
fn array_type_info() -> PgTypeInfo {
PgTypeInfo::BYTEA_ARRAY
}
}

impl PgHasArrayType for Vec<u8> {
fn array_type_info() -> PgTypeInfo {
<[&[u8]] as Type<Postgres>>::type_info()
Expand Down

0 comments on commit 7e7dded

Please sign in to comment.