@@ -9,7 +9,7 @@
99 , TypeOperators
1010#-}
1111
12−module Squeel.PostgreSQL.Value where
12+module Squeel.PostgreSQL.Binary where
1313
1414import Control.Arrow (left)
1515import Data.Aeson (FromJSON, ToJSON, eitherDecodeStrict, encode)
@@ -81,6 +81,15 @@ instance FromValue 'PGTimestampTZ UTCTime where
8181instance FromValue 'PGInterval DiffTime where
8282 fromValue _ = Decoder.interval_int
8383
84+class FromValues pgs xs where
85+ decodeValues :: Proxy# pgs -> Rec (Const ByteString) xs -> Rec (Either Text) xs
86+instance FromValues '[] '[] where decodeValues _ _ = RNil
87+instance (FromValue pg x, FromValues pgs xs)
88+ => FromValues (pg ': pgs) (x ': xs) where
89+ decodeValues _ (Const result :& results) =
90+ decodeValue (proxy# :: Proxy# pg) result
91+ :& decodeValues (proxy# :: Proxy# pgs) results
92+
8493class ToValue x (pg :: PGType) where
8594 toValue :: Proxy# pg -> Encoder x
8695instance ToValue Int16 'PGInt2 where