postgresql-query 3.8.0 → 3.8.1
raw patch · 4 files changed
+11/−4 lines, 4 files
Files
- CHANGELOG.md +1/−1
- postgresql-query.cabal +1/−1
- src/Database/PostgreSQL/Query/Entity/Functions.hs +2/−1
- src/Database/PostgreSQL/Query/TH/Entity.hs +7/−1
CHANGELOG.md view
@@ -1,6 +1,6 @@ # CHANGELOG -## 3.8.0+## 3.8.1 ### Changed * Compatibility with ghc-8.8.3
postgresql-query.cabal view
@@ -1,5 +1,5 @@ name: postgresql-query-version: 3.8.0+version: 3.8.1 synopsis: Sql interpolating quasiquote plus some kind of primitive ORM using it
src/Database/PostgreSQL/Query/Entity/Functions.hs view
@@ -27,6 +27,7 @@ import Database.PostgreSQL.Simple.FromField import Database.PostgreSQL.Simple.ToField +import qualified Control.Monad.Fail as F import qualified Data.List as L import qualified Data.List.NonEmpty as NL @@ -35,7 +36,7 @@ pgInsertEntity :: forall a m . ( MonadPostgres m, MonadLogger m, Entity a- , ToRow a, FromField (EntityId a) )+ , ToRow a, FromField (EntityId a), F.MonadFail m ) => a -> m (EntityId a) pgInsertEntity a = do
src/Database/PostgreSQL/Query/TH/Entity.hs view
@@ -87,12 +87,18 @@ [a] -> return a x -> fail $ "expected exactly 1 data constructor, but " ++ show (length x) ++ " got" econt <- [t|Entity $(conT tname)|]+ eidcont <- [t|EntityId $(conT tname)|] ConT entityIdName <- [t|EntityId|] let tnames = nameBase tname idname = tnames ++ "Id" unidname = "get" ++ idname idtype = ConT (eoIdType opts)-#if MIN_VERSION_template_haskell(2,12,0)+#if MIN_VERSION_template_haskell(2,15,0)+ idcon = RecC (mkName idname)+ [(mkName unidname, Bang NoSourceUnpackedness NoSourceStrictness, idtype)]+ iddec = NewtypeInstD [] Nothing eidcont Nothing+ idcon [DerivClause Nothing (map ConT $ eoDeriveClasses opts)]+#elif MIN_VERSION_template_haskell(2,12,0) idcon = RecC (mkName idname) [(mkName unidname, Bang NoSourceUnpackedness NoSourceStrictness, idtype)] iddec = NewtypeInstD [] entityIdName [ConT tname] Nothing