From dbf53c31fb21d22b6f6fb7839df06e28c0bbf569 Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Wed, 13 Sep 2017 16:27:18 -0600 Subject: [PATCH 01/13] use a compatibility class --- src/Database/Esqueleto/Internal/Language.hs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Database/Esqueleto/Internal/Language.hs b/src/Database/Esqueleto/Internal/Language.hs index 4226170..95ebe00 100644 --- a/src/Database/Esqueleto/Internal/Language.hs +++ b/src/Database/Esqueleto/Internal/Language.hs @@ -53,6 +53,11 @@ import qualified Data.ByteString as B import qualified Data.Text as T import qualified Data.Text.Lazy as TL +class BackendCompatible sup sub + +instance BackendCompatible SqlBackend SqlBackend +instance BackendCompatible SqlBackend SqlReadBackend +instance BackendCompatible SqlBackend SqlWriteBackend -- | Finally tagless representation of @esqueleto@'s EDSL. class (Functor query, Applicative query, Monad query) => @@ -72,12 +77,12 @@ class (Functor query, Applicative query, Monad query) => -- @JOIN@. fromStart :: ( PersistEntity a - , PersistEntityBackend a ~ backend ) + , BackendCompatible backend (PersistEntityBackend a) ) => query (expr (PreprocessedFrom (expr (Entity a)))) -- | (Internal) Same as 'fromStart', but entity may be missing. fromStartMaybe :: ( PersistEntity a - , PersistEntityBackend a ~ backend ) + , BackendCompatible backend (PersistEntityBackend a) ) => query (expr (PreprocessedFrom (expr (Maybe (Entity a))))) -- | (Internal) Do a @JOIN@. fromJoin @@ -1041,13 +1046,13 @@ class Esqueleto query expr backend => FromPreprocess query expr backend a where instance ( Esqueleto query expr backend , PersistEntity val - , PersistEntityBackend val ~ backend + , BackendCompatible backend (PersistEntityBackend val) ) => FromPreprocess query expr backend (expr (Entity val)) where fromPreprocess = fromStart instance ( Esqueleto query expr backend , PersistEntity val - , PersistEntityBackend val ~ backend + , BackendCompatible backend (PersistEntityBackend val) ) => FromPreprocess query expr backend (expr (Maybe (Entity val))) where fromPreprocess = fromStartMaybe From 5cd4b03ec9a14c8a60d4c734c06d5c87317e4c82 Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Wed, 13 Sep 2017 16:31:23 -0600 Subject: [PATCH 02/13] export --- src/Database/Esqueleto/Internal/Language.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Database/Esqueleto/Internal/Language.hs b/src/Database/Esqueleto/Internal/Language.hs index 95ebe00..724b98f 100644 --- a/src/Database/Esqueleto/Internal/Language.hs +++ b/src/Database/Esqueleto/Internal/Language.hs @@ -35,6 +35,7 @@ module Database.Esqueleto.Internal.Language -- * The guts , JoinKind(..) , IsJoinKind(..) + , BackendCompatible(..) , PreprocessedFrom , From , FromPreprocess From a01f9c856367d567861d8e59e71c46aecd12521a Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Wed, 13 Sep 2017 17:00:31 -0600 Subject: [PATCH 03/13] Add projection function --- src/Database/Esqueleto/Internal/Language.hs | 15 +++++++++++---- src/Database/Esqueleto/Internal/Sql.hs | 16 +++++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/Database/Esqueleto/Internal/Language.hs b/src/Database/Esqueleto/Internal/Language.hs index 724b98f..291d102 100644 --- a/src/Database/Esqueleto/Internal/Language.hs +++ b/src/Database/Esqueleto/Internal/Language.hs @@ -54,11 +54,18 @@ import qualified Data.ByteString as B import qualified Data.Text as T import qualified Data.Text.Lazy as TL -class BackendCompatible sup sub +class BackendCompatible sup sub where + projectBackend :: sub -> sup + +instance BackendCompatible SqlBackend SqlBackend where + projectBackend = id + +instance BackendCompatible SqlBackend SqlReadBackend where + projectBackend = unSqlReadBackend + +instance BackendCompatible SqlBackend SqlWriteBackend where + projectBackend = unSqlWriteBackend -instance BackendCompatible SqlBackend SqlBackend -instance BackendCompatible SqlBackend SqlReadBackend -instance BackendCompatible SqlBackend SqlWriteBackend -- | Finally tagless representation of @esqueleto@'s EDSL. class (Functor query, Applicative query, Monad query) => diff --git a/src/Database/Esqueleto/Internal/Sql.hs b/src/Database/Esqueleto/Internal/Sql.hs index 02861ab..0d99f3b 100644 --- a/src/Database/Esqueleto/Internal/Sql.hs +++ b/src/Database/Esqueleto/Internal/Sql.hs @@ -786,13 +786,16 @@ veryUnsafeCoerceSqlExprValueList EEmptyList = throw (UnexpectedCaseErr EmptySqlE -- @persistent@'s 'SqlPersistT' monad. rawSelectSource :: ( SqlSelect a r , MonadIO m1 - , MonadIO m2 ) + , MonadIO m2 + , SqlBackendCanRead backend + , BackendCompatible SqlBackend backend) => Mode -> SqlQuery a - -> SqlReadT m1 (Acquire (C.Source m2 r)) + -> R.ReaderT backend m1 (Acquire (C.Source m2 r)) rawSelectSource mode query = do - conn <- persistBackend <$> R.ask + conn <- projectBackend <$> R.ask + let _ = conn :: SqlBackend res <- run conn return $ (C.$= massage) `fmap` res where @@ -866,8 +869,11 @@ selectSource query = do -- function composition that the @p@ inside the query is of type -- @SqlExpr (Entity Person)@. select :: ( SqlSelect a r - , MonadIO m ) - => SqlQuery a -> SqlReadT m [r] + , MonadIO m + , SqlBackendCanRead backend + , BackendCompatible SqlBackend backend + ) + => SqlQuery a -> R.ReaderT backend m [r] select query = do res <- rawSelectSource SELECT query conn <- R.ask From d621f382bfee5ec1da866b17f72c659560108452 Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Wed, 13 Sep 2017 17:14:14 -0600 Subject: [PATCH 04/13] abstract --- src/Database/Esqueleto/Internal/Sql.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Database/Esqueleto/Internal/Sql.hs b/src/Database/Esqueleto/Internal/Sql.hs index 0d99f3b..4d272b5 100644 --- a/src/Database/Esqueleto/Internal/Sql.hs +++ b/src/Database/Esqueleto/Internal/Sql.hs @@ -781,17 +781,20 @@ veryUnsafeCoerceSqlExprValueList EEmptyList = throw (UnexpectedCaseErr EmptySqlE ---------------------------------------------------------------------- +type SqlReadT' m a + = forall backend + . (BackendCompatible SqlBackend backend, SqlBackendCanRead backend) + => R.ReaderT backend m a -- | (Internal) Execute an @esqueleto@ @SELECT@ 'SqlQuery' inside -- @persistent@'s 'SqlPersistT' monad. rawSelectSource :: ( SqlSelect a r , MonadIO m1 , MonadIO m2 - , SqlBackendCanRead backend - , BackendCompatible SqlBackend backend) + ) => Mode -> SqlQuery a - -> R.ReaderT backend m1 (Acquire (C.Source m2 r)) + -> SqlReadT' m1 (Acquire (C.Source m2 r)) rawSelectSource mode query = do conn <- projectBackend <$> R.ask @@ -870,10 +873,8 @@ selectSource query = do -- @SqlExpr (Entity Person)@. select :: ( SqlSelect a r , MonadIO m - , SqlBackendCanRead backend - , BackendCompatible SqlBackend backend ) - => SqlQuery a -> R.ReaderT backend m [r] + => SqlQuery a -> SqlReadT' m [r] select query = do res <- rawSelectSource SELECT query conn <- R.ask From 1a945d27c8d9efcfb001c27288b35507a9faefed Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Wed, 13 Sep 2017 17:23:46 -0600 Subject: [PATCH 05/13] no basebackend pls --- src/Database/Esqueleto/Internal/Sql.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Database/Esqueleto/Internal/Sql.hs b/src/Database/Esqueleto/Internal/Sql.hs index 4d272b5..1322c38 100644 --- a/src/Database/Esqueleto/Internal/Sql.hs +++ b/src/Database/Esqueleto/Internal/Sql.hs @@ -781,9 +781,12 @@ veryUnsafeCoerceSqlExprValueList EEmptyList = throw (UnexpectedCaseErr EmptySqlE ---------------------------------------------------------------------- -type SqlReadT' m a - = forall backend - . (BackendCompatible SqlBackend backend, SqlBackendCanRead backend) +type SqlReadT' m a = forall backend. + ( BackendCompatible SqlBackend backend + , IsPersistBackend backend + , PersistQueryRead backend + , PersistStoreRead backend, PersistUniqueRead backend + ) => R.ReaderT backend m a -- | (Internal) Execute an @esqueleto@ @SELECT@ 'SqlQuery' inside @@ -799,7 +802,7 @@ rawSelectSource mode query = do conn <- projectBackend <$> R.ask let _ = conn :: SqlBackend - res <- run conn + res <- R.withReaderT (const conn) (run conn) return $ (C.$= massage) `fmap` res where From 397ece45e2acce650519c3ee8925d67073653876 Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Wed, 13 Sep 2017 17:30:28 -0600 Subject: [PATCH 06/13] relax selectSource --- src/Database/Esqueleto/Internal/Sql.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Database/Esqueleto/Internal/Sql.hs b/src/Database/Esqueleto/Internal/Sql.hs index 1322c38..e6e48ef 100644 --- a/src/Database/Esqueleto/Internal/Sql.hs +++ b/src/Database/Esqueleto/Internal/Sql.hs @@ -824,9 +824,13 @@ rawSelectSource mode query = -- | Execute an @esqueleto@ @SELECT@ query inside @persistent@'s -- 'SqlPersistT' monad and return a 'C.Source' of rows. selectSource :: ( SqlSelect a r - , MonadResource m ) + , BackendCompatible SqlBackend backend + , IsPersistBackend backend + , PersistQueryRead backend + , PersistStoreRead backend, PersistUniqueRead backend + , MonadResource m ) => SqlQuery a - -> C.Source (SqlPersistT m) r + -> C.Source (R.ReaderT backend m) r selectSource query = do res <- lift $ rawSelectSource SELECT query (key, src) <- lift $ allocateAcquire res From 07167f6474618446fb5066af437fd1d304ac18b3 Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Mon, 23 Oct 2017 11:16:59 -0600 Subject: [PATCH 07/13] use upstream persistent --- esqueleto.cabal | 2 +- src/Database/Esqueleto/Internal/Language.hs | 13 ------------- stack-7.10.yaml | 2 +- stack-8.0.yaml | 1 + 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/esqueleto.cabal b/esqueleto.cabal index debe59f..5223c7d 100644 --- a/esqueleto.cabal +++ b/esqueleto.cabal @@ -66,7 +66,7 @@ library base >= 4.8 && < 5.0 , bytestring , text >= 0.11 && < 1.3 - , persistent >= 2.5 && < 2.8 + , persistent >= 2.7.1 && < 2.8 , transformers >= 0.2 , unordered-containers >= 0.2 , tagged >= 0.2 diff --git a/src/Database/Esqueleto/Internal/Language.hs b/src/Database/Esqueleto/Internal/Language.hs index 291d102..6ba0075 100644 --- a/src/Database/Esqueleto/Internal/Language.hs +++ b/src/Database/Esqueleto/Internal/Language.hs @@ -54,19 +54,6 @@ import qualified Data.ByteString as B import qualified Data.Text as T import qualified Data.Text.Lazy as TL -class BackendCompatible sup sub where - projectBackend :: sub -> sup - -instance BackendCompatible SqlBackend SqlBackend where - projectBackend = id - -instance BackendCompatible SqlBackend SqlReadBackend where - projectBackend = unSqlReadBackend - -instance BackendCompatible SqlBackend SqlWriteBackend where - projectBackend = unSqlWriteBackend - - -- | Finally tagless representation of @esqueleto@'s EDSL. class (Functor query, Applicative query, Monad query) => Esqueleto query expr backend | query -> expr backend, expr -> query backend where diff --git a/stack-7.10.yaml b/stack-7.10.yaml index f3e0bd7..318facf 100644 --- a/stack-7.10.yaml +++ b/stack-7.10.yaml @@ -3,4 +3,4 @@ packages: - '.' resolver: lts-6.12 extra-deps: - - persistent-2.5 + - persistent-2.7.1 diff --git a/stack-8.0.yaml b/stack-8.0.yaml index 5b854e7..1d884b7 100644 --- a/stack-8.0.yaml +++ b/stack-8.0.yaml @@ -7,6 +7,7 @@ packages: extra-deps: - doctest-prop-0.2.0.1 - quickcheck-properties-0.1 +- persistent-2.7.1 # - http-client-0.5.0 # - fail-4.9.0.0 # - http-types-0.9 From 23ac8da92ba607c17b99ee47c1d9a687336584e1 Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Mon, 23 Oct 2017 17:28:47 -0600 Subject: [PATCH 08/13] Remove SqlReadT --- src/Database/Esqueleto/Internal/Sql.hs | 20 ++++++-------------- stack-8.0.yaml | 9 ++++++++- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/Database/Esqueleto/Internal/Sql.hs b/src/Database/Esqueleto/Internal/Sql.hs index e6e48ef..80310c0 100644 --- a/src/Database/Esqueleto/Internal/Sql.hs +++ b/src/Database/Esqueleto/Internal/Sql.hs @@ -781,14 +781,6 @@ veryUnsafeCoerceSqlExprValueList EEmptyList = throw (UnexpectedCaseErr EmptySqlE ---------------------------------------------------------------------- -type SqlReadT' m a = forall backend. - ( BackendCompatible SqlBackend backend - , IsPersistBackend backend - , PersistQueryRead backend - , PersistStoreRead backend, PersistUniqueRead backend - ) - => R.ReaderT backend m a - -- | (Internal) Execute an @esqueleto@ @SELECT@ 'SqlQuery' inside -- @persistent@'s 'SqlPersistT' monad. rawSelectSource :: ( SqlSelect a r @@ -797,7 +789,7 @@ rawSelectSource :: ( SqlSelect a r ) => Mode -> SqlQuery a - -> SqlReadT' m1 (Acquire (C.Source m2 r)) + -> SqlReadT m1 (Acquire (C.Source m2 r)) rawSelectSource mode query = do conn <- projectBackend <$> R.ask @@ -881,7 +873,7 @@ selectSource query = do select :: ( SqlSelect a r , MonadIO m ) - => SqlQuery a -> SqlReadT' m [r] + => SqlQuery a -> SqlReadT m [r] select query = do res <- rawSelectSource SELECT query conn <- R.ask @@ -921,12 +913,12 @@ runSource src = src C.$$ CL.consume -- | (Internal) Execute an @esqueleto@ statement inside -- @persistent@'s 'SqlPersistT' monad. -rawEsqueleto :: ( MonadIO m, SqlSelect a r, IsSqlBackend backend) +rawEsqueleto :: ( MonadIO m, SqlSelect a r, BackendCompatible SqlBackend backend) => Mode -> SqlQuery a -> R.ReaderT backend m Int64 rawEsqueleto mode query = do - conn <- persistBackend <$> R.ask + conn <- R.ask uncurry rawExecuteCount $ first builderToText $ toRawSql mode (conn, initialIdentState) query @@ -1008,7 +1000,7 @@ builderToText = TL.toStrict . TLB.toLazyTextWith defaultChunkSize -- possible but tedious), you may just turn on query logging of -- @persistent@. toRawSql - :: (IsSqlBackend backend, SqlSelect a r) + :: (SqlSelect a r, BackendCompatible SqlBackend backend) => Mode -> (backend, IdentState) -> SqlQuery a -> (TLB.Builder, [PersistValue]) toRawSql mode (conn, firstIdentState) query = let ((ret, sd), finalIdentState) = @@ -1028,7 +1020,7 @@ toRawSql mode (conn, firstIdentState) query = -- that were used) to the subsequent calls. This ensures -- that no name clashes will occur on subqueries that may -- appear on the expressions below. - info = (persistBackend conn, finalIdentState) + info = (projectBackend conn, finalIdentState) in mconcat [ makeInsertInto info mode ret , makeSelect info mode distinctClause ret diff --git a/stack-8.0.yaml b/stack-8.0.yaml index 1d884b7..4f41cf0 100644 --- a/stack-8.0.yaml +++ b/stack-8.0.yaml @@ -4,10 +4,17 @@ resolver: lts-8.8 packages: - '.' +- location: + git: https://github.com/parsonsmatt/persistent + commit: a4f21ad5db9b65a5febf79a1be091597210a73ca + subdirs: + - persistent + extra-dep: true + extra-deps: - doctest-prop-0.2.0.1 - quickcheck-properties-0.1 -- persistent-2.7.1 + # - persistent-2.7.1 # - http-client-0.5.0 # - fail-4.9.0.0 # - http-types-0.9 From 68c180b8bb19fa5a38ce17a1a721de1a006036a9 Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Tue, 24 Oct 2017 11:09:50 -0600 Subject: [PATCH 09/13] Add patched Persistent to stack-7.10.yaml --- stack-7.10.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stack-7.10.yaml b/stack-7.10.yaml index 318facf..3db00fd 100644 --- a/stack-7.10.yaml +++ b/stack-7.10.yaml @@ -1,6 +1,13 @@ flags: {} packages: - '.' +- location: + git: https://github.com/parsonsmatt/persistent + commit: a4f21ad5db9b65a5febf79a1be091597210a73ca + subdirs: + - persistent + extra-dep: true + resolver: lts-6.12 extra-deps: - - persistent-2.7.1 + # - persistent-2.7.1 From 592a017e6cf9f713b4b36f629186c4178f4a6de4 Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Wed, 17 Jan 2018 13:08:20 -0700 Subject: [PATCH 10/13] don't use aliases --- src/Database/Esqueleto/Internal/Sql.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Database/Esqueleto/Internal/Sql.hs b/src/Database/Esqueleto/Internal/Sql.hs index 80310c0..a1f1b39 100644 --- a/src/Database/Esqueleto/Internal/Sql.hs +++ b/src/Database/Esqueleto/Internal/Sql.hs @@ -971,16 +971,22 @@ deleteCount = rawEsqueleto DELETE -- 'where_' $ isNothing (p '^.' PersonAge) -- @ update :: ( MonadIO m - , SqlEntity val ) + , SqlEntity val + , BackendCompatible SqlBackend backend + , PersistQueryWrite backend + , PersistUniqueWrite backend) => (SqlExpr (Entity val) -> SqlQuery ()) - -> SqlWriteT m () + -> R.ReaderT backend m () update = void . updateCount -- | Same as 'update', but returns the number of rows affected. updateCount :: ( MonadIO m - , SqlEntity val ) + , SqlEntity val + , BackendCompatible SqlBackend backend + , PersistQueryWrite backend + , PersistUniqueWrite backend) => (SqlExpr (Entity val) -> SqlQuery ()) - -> SqlWriteT m Int64 + -> R.ReaderT backend m Int64 updateCount = rawEsqueleto UPDATE . from From 7808bc982cd09530d2128c601f8e98156b756905 Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Fri, 19 Jan 2018 09:59:35 -0700 Subject: [PATCH 11/13] Compatibility with new persistent --- esqueleto.cabal | 6 +++--- stack-8.2.yaml | 36 ++++++++++++++++++++++++++++++++++++ test/Test.hs | 2 +- 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 stack-8.2.yaml diff --git a/esqueleto.cabal b/esqueleto.cabal index 5223c7d..be7cb4c 100644 --- a/esqueleto.cabal +++ b/esqueleto.cabal @@ -66,14 +66,14 @@ library base >= 4.8 && < 5.0 , bytestring , text >= 0.11 && < 1.3 - , persistent >= 2.7.1 && < 2.8 + , persistent >= 2.8.0 && < 2.9 , transformers >= 0.2 , unordered-containers >= 0.2 , tagged >= 0.2 , monad-logger - , conduit >= 1.1 - , resourcet >= 1.1 + , conduit >= 1.3 + , resourcet >= 1.2 , time >= 1.5.0.1 && <= 1.8.0.2 , blaze-html hs-source-dirs: src/ diff --git a/stack-8.2.yaml b/stack-8.2.yaml new file mode 100644 index 0000000..9701823 --- /dev/null +++ b/stack-8.2.yaml @@ -0,0 +1,36 @@ +# resolver: nightly-2017-01-10 +resolver: lts-10.0 +# compiler: ghc-8.0.2 + +packages: +- '.' +- location: + git: https://github.com/yesodweb/persistent + commit: 4d0a6f3a4abde46c82691414e0e283a933a39f3e + extra-dep: true + subdirs: + - persistent + - persistent-sqlite +- location: + git: https://github.com/snoyberg/conduit + commit: 7f75bfca8d479e1737861a75437a288af662a3cf + extra-dep: true + subdirs: + - conduit + - conduit-extra + - resourcet + +extra-deps: +- doctest-prop-0.2.0.1 +- quickcheck-properties-0.1 +- monad-logger-0.3.28 +- mono-traversable-1.0.8.1 + # - persistent-2.7.1 +# - http-client-0.5.0 +# - fail-4.9.0.0 +# - http-types-0.9 +# - attoparsec-0.13.0.1 +# - doctest-0.10.1 +# - semigroups-0.18.0.1 +# - uri-bytestring-0.1.9 +# - temporary-resourcet-0.1.0.0 diff --git a/test/Test.hs b/test/Test.hs index f52c7f5..d948dd5 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -1482,7 +1482,7 @@ insert' :: ( Functor m insert' v = flip Entity v <$> insert v -type RunDbMonad m = ( MonadBaseControl IO m, MonadIO m, MonadLogger m +type RunDbMonad m = ( R.MonadUnliftIO m, MonadIO m, MonadLogger m , R.MonadThrow m ) #if defined (WITH_POSTGRESQL) || defined (WITH_MYSQL) From e53f087d217c57994b01b648e11dab45ff1b797b Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Fri, 19 Jan 2018 11:23:45 -0700 Subject: [PATCH 12/13] ah, yes, that is hardcoded --- src/Database/Esqueleto/Internal/Sql.hs | 22 ++++++++++++++-------- stack-8.2.yaml | 2 ++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/Database/Esqueleto/Internal/Sql.hs b/src/Database/Esqueleto/Internal/Sql.hs index a1f1b39..2888529 100644 --- a/src/Database/Esqueleto/Internal/Sql.hs +++ b/src/Database/Esqueleto/Internal/Sql.hs @@ -970,18 +970,24 @@ deleteCount = rawEsqueleto DELETE -- 'set' p [ PersonAge '=.' 'just' ('val' thisYear) -. p '^.' PersonBorn ] -- 'where_' $ isNothing (p '^.' PersonAge) -- @ -update :: ( MonadIO m - , SqlEntity val - , BackendCompatible SqlBackend backend - , PersistQueryWrite backend - , PersistUniqueWrite backend) - => (SqlExpr (Entity val) -> SqlQuery ()) - -> R.ReaderT backend m () +update + :: + ( PersistEntityBackend val ~ backend + , PersistEntity val + , PersistUniqueWrite backend + , PersistQueryWrite backend + , BackendCompatible SqlBackend backend + , PersistEntity val + , MonadIO m + ) + => (SqlExpr (Entity val) -> SqlQuery ()) + -> R.ReaderT backend m () update = void . updateCount -- | Same as 'update', but returns the number of rows affected. updateCount :: ( MonadIO m - , SqlEntity val + , PersistEntity val + , PersistEntityBackend val ~ backend , BackendCompatible SqlBackend backend , PersistQueryWrite backend , PersistUniqueWrite backend) diff --git a/stack-8.2.yaml b/stack-8.2.yaml index 9701823..4a80bef 100644 --- a/stack-8.2.yaml +++ b/stack-8.2.yaml @@ -25,6 +25,8 @@ extra-deps: - quickcheck-properties-0.1 - monad-logger-0.3.28 - mono-traversable-1.0.8.1 +- typed-process-0.2.1.0 +- persistent-2.8.0 # - persistent-2.7.1 # - http-client-0.5.0 # - fail-4.9.0.0 From 86c4c1a7b624e25f459837a40cba4c2b45bebc98 Mon Sep 17 00:00:00 2001 From: Matt Parsons Date: Thu, 15 Feb 2018 17:50:12 -0700 Subject: [PATCH 13/13] bump deps --- esqueleto.cabal | 2 +- stack-8.2.yaml | 46 +++++++++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/esqueleto.cabal b/esqueleto.cabal index be7cb4c..6fa514a 100644 --- a/esqueleto.cabal +++ b/esqueleto.cabal @@ -98,7 +98,7 @@ test-suite test , HUnit , QuickCheck , hspec >= 1.8 - , persistent-sqlite >= 2.1.3 + , persistent-sqlite >= 2.8.0 , persistent-template >= 2.1 , monad-control , monad-logger >= 0.3 diff --git a/stack-8.2.yaml b/stack-8.2.yaml index 4a80bef..57b8420 100644 --- a/stack-8.2.yaml +++ b/stack-8.2.yaml @@ -1,32 +1,36 @@ # resolver: nightly-2017-01-10 -resolver: lts-10.0 +resolver: lts-10.4 # compiler: ghc-8.0.2 packages: - '.' -- location: - git: https://github.com/yesodweb/persistent - commit: 4d0a6f3a4abde46c82691414e0e283a933a39f3e - extra-dep: true - subdirs: - - persistent - - persistent-sqlite -- location: - git: https://github.com/snoyberg/conduit - commit: 7f75bfca8d479e1737861a75437a288af662a3cf - extra-dep: true - subdirs: - - conduit - - conduit-extra - - resourcet + # - location: + # git: https://github.com/yesodweb/persistent + # commit: 4d0a6f3a4abde46c82691414e0e283a933a39f3e + # extra-dep: true + # subdirs: + # - persistent + # - persistent-sqlite + # - location: + # git: https://github.com/snoyberg/conduit + # commit: 7f75bfca8d479e1737861a75437a288af662a3cf + # extra-dep: true + # subdirs: + # - conduit + # - conduit-extra + # - resourcet extra-deps: -- doctest-prop-0.2.0.1 -- quickcheck-properties-0.1 -- monad-logger-0.3.28 -- mono-traversable-1.0.8.1 -- typed-process-0.2.1.0 + # - doctest-prop-0.2.0.1 + # - quickcheck-properties-0.1 + # - monad-logger-0.3.28 + # - mono-traversable-1.0.8.1 + # - typed-process-0.2.1.0 - persistent-2.8.0 +- persistent-sqlite-2.8.0 +- conduit-1.3.0 +- conduit-extra-1.3.0 +- resourcet-1.2.0 # - persistent-2.7.1 # - http-client-0.5.0 # - fail-4.9.0.0