@@ -276,6 +276,7 @@ instance ToParam UTCTime 'PGtimestamptz where
276instance ToParam DiffTime 'PGinterval where toParam = K . Encoding.interval_int
276instance ToParam DiffTime 'PGinterval where toParam = K . Encoding.interval_int
277instance ToParam Value 'PGjson where toParam = K . Encoding.json_ast
277instance ToParam Value 'PGjson where toParam = K . Encoding.json_ast
278instance ToParam Value 'PGjsonb where toParam = K . Encoding.jsonb_ast
278instance ToParam Value 'PGjsonb where toParam = K . Encoding.jsonb_ast
279+instance ToParam Jsonb 'PGjsonb where toParam = toParam . getJsonb
279instance ToArray x ('NotNull ('PGvararray ty))
280instance ToArray x ('NotNull ('PGvararray ty))
280 => ToParam x ('PGvararray ty) where
281 => ToParam x ('PGvararray ty) where
@@ -286,6 +287,8 @@ instance ToArray x ('NotNull ('PGfixarray n ty))
287 = K . Encoding.array (baseOid @x @('NotNull ('PGfixarray n ty)))
288 = K . Encoding.array (baseOid @x @('NotNull ('PGfixarray n ty)))
288 . unK . toArray @x @('NotNull ('PGfixarray n ty))
289 . unK . toArray @x @('NotNull ('PGfixarray n ty))
290+instance ToParam x pg => ToParam (Enumerated x) pg where
291+ toParam = toParam . getEnumerated
290 ( IsEnumType x
293 ( IsEnumType x
291 , HasDatatypeInfo x
294 , HasDatatypeInfo x
@@ -304,6 +307,8 @@ instance
304 . Strict.pack
307 . Strict.pack
305 . gshowConstructor (constructorInfo (datatypeInfo (Proxy @x)))
308 . gshowConstructor (constructorInfo (datatypeInfo (Proxy @x)))
310+instance ToParam x pg => ToParam (Composite x) pg where
311+ toParam = toParam . getComposite
308 ( SListI fields
313 ( SListI fields
309 , IsRecord x xs
314 , IsRecord x xs
@@ -448,12 +453,16 @@ instance FromValue 'PGinterval DiffTime where
448 fromValue = Decoding.interval_int
453 fromValue = Decoding.interval_int
449instance FromValue 'PGjson Value where fromValue = Decoding.json_ast
454instance FromValue 'PGjson Value where fromValue = Decoding.json_ast
450instance FromValue 'PGjsonb Value where fromValue = Decoding.jsonb_ast
455instance FromValue 'PGjsonb Value where fromValue = Decoding.jsonb_ast
456+instance FromValue 'PGjsonb Jsonb where
457+ fromValue = Jsonb <$> fromValue @'PGjsonb
451instance FromArray ('NotNull ('PGvararray ty)) y
458instance FromArray ('NotNull ('PGvararray ty)) y
452 => FromValue ('PGvararray ty) y where
459 => FromValue ('PGvararray ty) y where
453 fromValue = Decoding.array (fromArray @('NotNull ('PGvararray ty)) @y)
460 fromValue = Decoding.array (fromArray @('NotNull ('PGvararray ty)) @y)
454instance FromArray ('NotNull ('PGfixarray n ty)) y
461instance FromArray ('NotNull ('PGfixarray n ty)) y
455 => FromValue ('PGfixarray n ty) y where
462 => FromValue ('PGfixarray n ty) y where
456 fromValue = Decoding.array (fromArray @('NotNull ('PGfixarray n ty)) @y)
463 fromValue = Decoding.array (fromArray @('NotNull ('PGfixarray n ty)) @y)
464+instance FromValue pg y => FromValue pg (Enumerated y) where
465+ fromValue = Enumerated <$> fromValue @pg
458 ( IsEnumType y
467 ( IsEnumType y
459 , HasDatatypeInfo y
468 , HasDatatypeInfo y
@@ -476,7 +485,8 @@ instance
476 $ fmap to
485 $ fmap to
477 . greadConstructor (constructorInfo (datatypeInfo (Proxy @y)))
486 . greadConstructor (constructorInfo (datatypeInfo (Proxy @y)))
478 . Strict.unpack
487 . Strict.unpack
479−
488+instance FromValue pg y => FromValue pg (Composite y) where
489+ fromValue = Composite <$> fromValue @pg
481 ( FromRow fields y
491 ( FromRow fields y
482 ) => FromValue ('PGcomposite fields) y where
492 ) => FromValue ('PGcomposite fields) y where