@@ -203,6 +203,14 @@ instance FromValue pg y => FromValue ('PGfixarray n pg) (Vector (Maybe y)) where
203 fromValue _ = Decoding.array
203 fromValue _ = Decoding.array
204 (Decoding.dimensionArray Vector.replicateM
204 (Decoding.dimensionArray Vector.replicateM
205 (Decoding.nullableValueArray (fromValue (Proxy @pg))))
205 (Decoding.nullableValueArray (fromValue (Proxy @pg))))
209+ , IsProductType y (Maybes ys)
210+ , AllZip FromAliasedValue fields ys
211+ , SameFields (DatatypeInfoOf y) fields
212+ ) => FromValue ('PGcomposite fields) y where
213+ fromValue = fmap (to . SOP . Z . maybes) . composite . decoders
207class IsMaybes (xs :: [Type]) where
215class IsMaybes (xs :: [Type]) where
208 type family Maybes xs = (mxs :: [Type]) | mxs -> xs
216 type family Maybes xs = (mxs :: [Type]) | mxs -> xs
@@ -221,15 +229,6 @@ class FromAliasedValue (pg :: (Symbol,PGType)) (y :: Type) where
221instance FromValue pg y => FromAliasedValue (alias ::: pg) y where
229instance FromValue pg y => FromAliasedValue (alias ::: pg) y where
222 fromAliasedValue _ = fromValue (Proxy @pg)
230 fromAliasedValue _ = fromValue (Proxy @pg)
227− , IsProductType y (Maybes ys)
228− , AllZip FromAliasedValue fields ys
229− , SameFields (DatatypeInfoOf y) fields
230− ) => FromValue ('PGcomposite fields) y where
231− fromValue = fmap (to . SOP . Z . maybes) . composite . decoders
234 :: forall pgs ys proxy
233 :: forall pgs ys proxy
235 . AllZip FromAliasedValue pgs ys
234 . AllZip FromAliasedValue pgs ys