Move column increment to decodeField
This commit is contained in:
		
							parent
							
								
									ff615b6172
								
							
						
					
					
						commit
						d54cf6ea7f
					
				| @ -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 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user