merge small transaction module.

This commit is contained in:
Kei Hibino 2016-12-19 17:53:17 +09:00
parent c9e9212564
commit c5d1ed3288
3 changed files with 11 additions and 21 deletions

View File

@ -18,7 +18,6 @@ cabal-version: >=1.10
library
exposed-modules:
Test.Relational.QuickCheck.Model
Test.Relational.QuickCheck.Transaction
Test.Relational.QuickCheck.Arbitrary
Test.Relational.QuickCheck.Tests

View File

@ -1,3 +1,5 @@
{-# LANGUAGE FlexibleContexts #-}
module Test.Relational.QuickCheck.Tests (
qPred1, qJoin1,
) where
@ -5,17 +7,23 @@ module Test.Relational.QuickCheck.Tests (
import Test.QuickCheck (Property, ioProperty)
import Control.Monad (unless)
import Data.List (sort)
import Database.HDBC (IConnection, rollback)
import Database.HDBC (IConnection, rollback, SqlValue)
import Database.HDBC.Session (withConnectionIO')
import Database.Record (ToSql)
import Database.Relational.Query
import Database.HDBC.Record (runQuery')
import Database.HDBC.Record (runQuery', runInsert)
import Test.Relational.QuickCheck.Transaction (initializeTable)
import Test.Relational.QuickCheck.Model
import Test.Relational.QuickCheck.Arbitrary
(Selector (..), D(..), Pred (..), predSQL, predHask, Ranged (..), )
initializeTable :: (IConnection conn, TableDerivable a, ToSql SqlValue a)
=> conn
-> [a]
-> IO ()
initializeTable conn xs = mapM_ (runInsert conn $ derivedInsert id') xs
qPred1 :: IConnection conn
=> IO conn
-> D (Pred A)

View File

@ -1,17 +0,0 @@
{-# LANGUAGE FlexibleContexts #-}
module Test.Relational.QuickCheck.Transaction (
initializeTable,
) where
import Database.HDBC (IConnection, SqlValue)
import Database.Record (ToSql)
import Database.Relational.Query
import Database.HDBC.Record (runInsert)
initializeTable :: (IConnection conn, TableDerivable a, ToSql SqlValue a)
=> conn
-> [a]
-> IO ()
initializeTable conn xs = mapM_ (runInsert conn $ derivedInsert id') xs