Skip to content

Commit

Permalink
fix fromsql for domains
Browse files Browse the repository at this point in the history
  • Loading branch information
zacknewman authored Nov 20, 2024
1 parent 6ae17e0 commit 113d410
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion postgres-derive/src/fromsql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ fn domain_accepts_body(name: &str, field: &syn::Field) -> TokenStream {
fn domain_body(ident: &Ident, field: &syn::Field) -> TokenStream {
let ty = &field.ty;
quote! {
<#ty as postgres_types::FromSql>::from_sql(_type, buf).map(#ident)
<#ty as postgres_types::FromSql>::from_sql(match *_type.kind() {
postgres_types::Kind::Domain(ref _type) => _type,
_ => _type
}, buf).map(#ident)
}
}

Expand Down

0 comments on commit 113d410

Please sign in to comment.