on master help sign in
fix compilation issue in CSV output
commitac258daf249f65a66224485c9b1e054d43387bdf authorAgentM <agentm@themactionfaction.com> dateTue 21 Jul 2015, 13:42 (11 years ago) parentc773942
1 file changed+2−1
ProjectM36/Relation/Show/CSV.hs+2−1
ProjectM36/Relation/Show/CSV.hs+2−1
@@ -11,7 +11,7 @@ relationAsCSV :: Relation -> BS.ByteString
1111relationAsCSV (Relation _ tupleSet) = tupleSetAsCSV tupleSet
1212
1313tupleSetAsCSV :: RelationTupleSet -> BS.ByteString
14−tupleSetAsCSV tupleSet = encode $ HS.toList tupleSet
14+tupleSetAsCSV tupleSet = encode $ V.fromList (HS.toList tupleSet)
1515
1616instance ToRecord RelationTuple where
1717 toRecord tuple = toRecord $ map toField (V.toList $ tupleAtoms tuple)
@@ -20,6 +20,7 @@ instance ToField Atom where
2020 toField (BoolAtom atom) = toField (if atom then "t" else "f")
2121 toField (StringAtom atom) = toField atom
2222 toField (IntAtom atom) = toField atom
23+ toField (DateTimeAtom atom) = toField (show atom)
2324 toField (RelationAtom _) = undefined -- CSV does not support nested relations- this should likely be detected and rejected
2425
2526