Skip to content

Commit

Permalink
impl AsSqlType for Option<Vec<_>>
Browse files Browse the repository at this point in the history
  • Loading branch information
rkusa committed Nov 27, 2024
1 parent 81f7bc0 commit c1efcb5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions postgres/src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,26 @@ where
type SqlType = Vec<T::Type>;
}

impl<T> AsSqlType for Option<Vec<T>>
where
T: SqlType,
{
type SqlType = Vec<T::Type>;
}

// BYTEA
impl AsSqlType for Vec<u8> {
type SqlType = Bytea;
}
impl AsSqlType for Option<Vec<u8>> {
type SqlType = Bytea;
}
impl<'a> AsSqlType for &'a [u8] {
type SqlType = Bytea;
}
impl<'a> AsSqlType for Option<&'a [u8]> {
type SqlType = Bytea;
}

impl AsSqlType for Vec<Vec<u8>> {
type SqlType = Self;
Expand Down

0 comments on commit c1efcb5

Please sign in to comment.