From d8e546eb86a18c4e61c2e2f0844d5c29dd358d38 Mon Sep 17 00:00:00 2001 From: Raveline Date: Fri, 3 May 2019 10:25:18 +0200 Subject: Bump squeal version --- src/Squeal/PostgreSQL/Hspec.hs | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'src/Squeal') diff --git a/src/Squeal/PostgreSQL/Hspec.hs b/src/Squeal/PostgreSQL/Hspec.hs index 44011b7..3cd886b 100644 --- a/src/Squeal/PostgreSQL/Hspec.hs +++ b/src/Squeal/PostgreSQL/Hspec.hs @@ -10,7 +10,6 @@ The libary also provides a few other functions for more fine grained control ove -} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE KindSignatures #-} {-# LANGUAGE MonoLocalBinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} @@ -21,13 +20,11 @@ where import Control.Exception import Control.Monad -import Control.Monad.Base (liftBase) -import Control.Monad.Trans.Control (MonadBaseControl) -import qualified Data.ByteString.Char8 as BSC -import qualified Database.Postgres.Temp as Temp -import Generics.SOP (K) +import Control.Monad.Base (liftBase) +import qualified Data.ByteString.Char8 as BSC +import qualified Database.Postgres.Temp as Temp +import Generics.SOP (K) import Squeal.PostgreSQL -import Squeal.PostgreSQL.Migration import Squeal.PostgreSQL.Pool import Test.Hspec @@ -38,17 +35,13 @@ data TestDB a = TestDB -- ^ Pool of 50 connections to the temporary @postgres@ } -type Migrations schema m a = (MonadBaseControl IO m) => - PQ (("schema_migrations" ::: Table MigrationsTable) ': '[]) - (("schema_migrations" ::: Table MigrationsTable) ': schema) m a - type Fixtures schema = (Pool (K Connection schema) -> IO ()) type Actions schema a = PoolPQ schema IO a -type SquealContext (schema :: SchemaType) = TestDB (K Connection schema) +type SquealContext schema = TestDB (K Connection schema) -- | Start a temporary @postgres@ process and create a pool of connections to it setupDB - :: Migrations schema IO a + :: AlignedList (Migration (Terminally PQ IO)) schema0 schema -> Fixtures schema -> IO (SquealContext schema) setupDB migration fixtures = do @@ -63,7 +56,7 @@ setupDB migration fixtures = do singleStripe keepConnectionForOneHour poolSizeOfFifty - withConnection connectionString migration + withConnection connectionString (migrateUp migration) fixtures pool pure TestDB {..} @@ -105,7 +98,7 @@ itDB msg action = it msg $ void . withDB action -- -- hook for stopping a db. describeDB - :: Migrations schema IO a + :: AlignedList (Migration (Terminally PQ IO)) schema0 schema -> Fixtures schema -> String -> SpecWith (SquealContext schema) -- cgit v1.2.3