@@ -100,7 +100,7 @@ recordsAsRelation [] = Left EmptyTuplesError
100recordsAsRelation recordZips = do
100recordsAsRelation recordZips = do
101 tupleList <- mapM (uncurry recordAsTuple) recordZips
101 tupleList <- mapM (uncurry recordAsTuple) recordZips
102 let oneTuple = head tupleList
102 let oneTuple = head tupleList
103− mkRelation (tupleAttributes oneTuple) (HS.fromList tupleList)
103+ mkRelation (tupleAttributes oneTuple) (RelationTupleSet tupleList)
105keyFromValuesOrDie :: (Trans.MonadIO m,
105keyFromValuesOrDie :: (Trans.MonadIO m,
106 PersistEntity record,
106 PersistEntity record,
@@ -525,7 +525,7 @@ instance PersistQuery C.Connection where
525 rel <- Trans.liftIO $ C.executeRelationalExpr conn restrictionExpr
525 rel <- Trans.liftIO $ C.executeRelationalExpr conn restrictionExpr
526 case rel of
526 case rel of
527 Left err -> Trans.liftIO $ throwIO $ PersistError (T.pack (show err))
527 Left err -> Trans.liftIO $ throwIO $ PersistError (T.pack (show err))
528− Right (Relation _ tupleSet) -> mapM tupleMapper $ HS.toList tupleSet --refactor to use some relation accessors- here we convert a relation to a matrix, effectively (especially to support future sorting)
528+ Right (Relation _ tupleSet) -> mapM tupleMapper $ asList tupleSet --refactor to use some relation accessors- here we convert a relation to a matrix, effectively (especially to support future sorting)
529 case entities of
529 case entities of
530 Left err -> Trans.liftIO $ throwIO $ PersistError (T.pack $ show err)
530 Left err -> Trans.liftIO $ throwIO $ PersistError (T.pack $ show err)
531 Right entities' -> return $ return $ CL.sourceList entities'
531 Right entities' -> return $ return $ CL.sourceList entities'
@@ -545,7 +545,7 @@ instance PersistQuery C.Connection where
545 case keyFromValues (map atomAsPersistValue (V.toList atoms)) of
545 case keyFromValues (map atomAsPersistValue (V.toList atoms)) of
546 Left err -> Trans.liftIO $ throwIO $ PersistError "keyFromValues failure"
546 Left err -> Trans.liftIO $ throwIO $ PersistError "keyFromValues failure"
547 Right key -> right key
547 Right key -> right key
548− mapM keyMapper $ HS.toList tupleSet
548+ mapM keyMapper $ asList tupleSet
549 case keys of
549 case keys of
550 Left err -> Trans.liftIO $ throwIO $ PersistError "keyFromValues failure2"
550 Left err -> Trans.liftIO $ throwIO $ PersistError "keyFromValues failure2"
551 Right keys' -> return $ return (CL.sourceList keys')
551 Right keys' -> return $ return (CL.sourceList keys')