diff --git a/lib/Database/PostgreSQL/Opium.hs b/lib/Database/PostgreSQL/Opium.hs index 0d734e0..15f024d 100644 --- a/lib/Database/PostgreSQL/Opium.hs +++ b/lib/Database/PostgreSQL/Opium.hs @@ -131,9 +131,8 @@ instance FromRow' f => FromRow' (M1 C c f) where fromRow' ctx row = M1 <$> fromRow' ctx row instance (FromRow' f, FromRow' g) => FromRow' (f :*: g) where - fromRow' ctx@(FromRowCtx _ _ iRef) row = do + fromRow' ctx row = do y <- fromRow' ctx row - liftIO $ modifyIORef' iRef (+1) z <- fromRow' ctx row pure $ y :*: z @@ -146,6 +145,7 @@ decodeField -> ExceptT Error IO (M1 S m (Rec0 t') p) decodeField nameText g (FromRowCtx result columnTable iRef) row = do i <- liftIO $ readIORef iRef + liftIO $ modifyIORef' iRef (+1) let (column, oid) = columnTable `indexColumnTable` i mbField <- liftIO $ getFieldText column mbValue <- except $ getValue oid mbField