mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2025-01-06 04:16:21 +03:00
merge small transaction module.
This commit is contained in:
parent
c9e9212564
commit
c5d1ed3288
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user