]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/Odds.hs
Replace all raw DELETE queries with deleteAll.
[dead/htsn-import.git] / src / TSN / XML / Odds.hs
index 5d95ca448cc7099979ef2c4638f41c560709db8f..b8888af2052d62f7fd5e85fdc61f907d9aaae20d 100644 (file)
@@ -12,6 +12,7 @@
 --   other... disorganized... information.
 --
 module TSN.XML.Odds (
+  dtd,
   pickle_message,
   -- * Tests
   odds_tests,
@@ -32,7 +33,7 @@ import Database.Groundhog (
   (=.),
   (==.),
   countAll,
-  executeRaw,
+  deleteAll,
   insert_,
   migrate,
   runMigration,
@@ -77,6 +78,12 @@ import Xml (
   unsafe_unpickle )
 
 
+-- | The DTD to which this module corresponds. Used to invoke dbimport.
+--
+dtd :: String
+dtd = "Odds_XML.dtd"
+
+
 --
 -- DB/XML data types
 --
@@ -830,8 +837,7 @@ test_on_delete_cascade = testGroup "cascading delete tests"
                     migrate e
                     migrate f
                   _ <- dbimport odds
-                  -- No idea how 'delete' works, so do this instead.
-                  executeRaw False "DELETE FROM odds;" []
+                  deleteAll a
                   count_a <- countAll a
                   count_b <- countAll b
                   count_c <- countAll c