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 ++++++++--------------- stack.yaml | 12 ++++++++---- 2 files changed, 16 insertions(+), 19 deletions(-) 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) diff --git a/stack.yaml b/stack.yaml index 913ef7a..2b8364b 100644 --- a/stack.yaml +++ b/stack.yaml @@ -18,7 +18,7 @@ # # resolver: ./custom-snapshot.yaml # resolver: https://example.com/snapshots/2018-01-01.yaml -resolver: lts-12.20 +resolver: lts-13.18 # User packages to be built. # Various formats can be used as shown in the example below. @@ -40,9 +40,13 @@ packages: # using the same syntax as the packages field. # (e.g., acme-missiles-0.3) extra-deps: - - squeal-postgresql-0.4.0.0 - - records-sop-0.1.0.2 - - tmp-postgres-0.1.1.0 + - git: https://github.com/morphismtech/squeal + commit: cd3de98230645ba763183fcae3f7c38faf119c89 + subdirs: + - squeal-postgresql + - unliftio-pool-0.2.1.0@sha256:4de658feb1b10051c5af024c20cd7baa369c777716c54a7b3e2888a73286aecf + - records-sop-0.1.0.2 + - tmp-postgres-0.1.1.0 # Override default flag values for local packages and extra-deps # flags: {} -- cgit v1.2.3