diff --git a/postgres-types/src/lib.rs b/postgres-types/src/lib.rs index e912b378..8f758e97 100644 --- a/postgres-types/src/lib.rs +++ b/postgres-types/src/lib.rs @@ -868,6 +868,10 @@ where T::accepts(ty) } + fn encode_format(&self) -> Format { + (*self).encode_format() + } + to_sql_checked!(); } @@ -887,6 +891,13 @@ impl ToSql for Option { ::accepts(ty) } + fn encode_format(&self) -> Format { + match self { + Some(ref val) => val.encode_format(), + None => Format::Binary, + } + } + to_sql_checked!(); }