@@ -11,7 +11,7 @@ relationAsCSV :: Relation -> BS.ByteString
11relationAsCSV (Relation _ tupleSet) = tupleSetAsCSV tupleSet
11relationAsCSV (Relation _ tupleSet) = tupleSetAsCSV tupleSet
13tupleSetAsCSV :: RelationTupleSet -> BS.ByteString
13tupleSetAsCSV :: RelationTupleSet -> BS.ByteString
14−tupleSetAsCSV tupleSet = encode $ HS.toList tupleSet
14+tupleSetAsCSV tupleSet = encode $ V.fromList (HS.toList tupleSet)
16instance ToRecord RelationTuple where
16instance ToRecord RelationTuple where
17 toRecord tuple = toRecord $ map toField (V.toList $ tupleAtoms tuple)
17 toRecord tuple = toRecord $ map toField (V.toList $ tupleAtoms tuple)
@@ -20,6 +20,7 @@ instance ToField Atom where
20 toField (BoolAtom atom) = toField (if atom then "t" else "f")
20 toField (BoolAtom atom) = toField (if atom then "t" else "f")
21 toField (StringAtom atom) = toField atom
21 toField (StringAtom atom) = toField atom
22 toField (IntAtom atom) = toField atom
22 toField (IntAtom atom) = toField atom
23+ toField (DateTimeAtom atom) = toField (show atom)
23 toField (RelationAtom _) = undefined -- CSV does not support nested relations- this should likely be detected and rejected
24 toField (RelationAtom _) = undefined -- CSV does not support nested relations- this should likely be detected and rejected