X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTSN%2FXML%2FNews.hs;h=276151978f0d962a280ec8f83304308aaa7b554e;hb=cb5fd814ce4dbb761ebbff4771f16d97b1910173;hp=86eed4a8682679abe61c5cc1751375fba1bc3316;hpb=b830faafac5d720a8eecae369806d9142a186485;p=dead%2Fhtsn-import.git diff --git a/src/TSN/XML/News.hs b/src/TSN/XML/News.hs index 86eed4a..2761519 100644 --- a/src/TSN/XML/News.hs +++ b/src/TSN/XML/News.hs @@ -3,7 +3,6 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} @@ -11,6 +10,7 @@ -- a root element \ that contains an entire news item. -- module TSN.XML.News ( + dtd, pickle_message, -- * Tests news_tests, @@ -30,7 +30,7 @@ import Data.Tuple.Curry ( uncurryN ) import Data.Typeable ( Typeable ) import Database.Groundhog ( countAll, - executeRaw, + deleteAll, insert_, migrate, runMigration, @@ -73,6 +73,12 @@ import Xml ( unsafe_unpickle ) +-- | The DTD to which this module corresponds. Used to invoke dbimport. +-- +dtd :: String +dtd = "newsxml.dtd" + + -- -- DB/XML Data types -- @@ -523,8 +529,7 @@ test_on_delete_cascade = testGroup "cascading delete tests" migrate d migrate e _ <- dbimport news - -- No idea how 'delete' works, so do this instead. - executeRaw False "DELETE FROM news;" [] + deleteAll a count_a <- countAll a count_b <- countAll b count_c <- countAll c