relax attoparsec upper bound

This commit is contained in:
parsonsmatt 2021-05-20 10:10:22 -06:00
parent cd16b2b22f
commit 129b1734c3
4 changed files with 38 additions and 1 deletions

View File

@ -47,7 +47,7 @@ library
build-depends:
base >=4.8 && <5.0
, aeson >=1.0
, attoparsec >= 0.13 && < 0.14
, attoparsec >= 0.13 && < 0.15
, blaze-html
, bytestring
, conduit >=1.3

View File

@ -6,6 +6,7 @@ packages:
extra-deps:
- lift-type-0.1.0.1
- attoparsec-0.14.1
- persistent-2.13.0.0
- persistent-sqlite-2.13.0.0
- persistent-mysql-2.13.0.0

View File

@ -34,6 +34,8 @@ module Common.Test
, cleanUniques
, RunDbMonad
, Run
, updateRethrowingQuery
, selectRethrowingQuery
, p1, p2, p3, p4, p5
, l1, l2, l3
, u1, u2, u3, u4
@ -2578,3 +2580,17 @@ selectRethrowingQuery query =
`catch` \(SomeException e) -> do
(text, _) <- renderQuerySelect query
liftIO . throwIO . userError $ Text.unpack text <> "\n\n" <> show e
updateRethrowingQuery
::
( MonadUnliftIO m
, PersistEntity val
, BackendCompatible SqlBackend (PersistEntityBackend val)
)
=> (SqlExpr (Entity val) -> SqlQuery ())
-> SqlWriteT m ()
updateRethrowingQuery k =
update k
`catch` \(SomeException e) -> do
(text, _) <- renderQueryUpdate (from k)
liftIO . throwIO . userError $ Text.unpack text <> "\n\n" <> show e

View File

@ -1423,6 +1423,26 @@ main = do
testJSONInsertions
testJSONOperators
testLateralQuery
testUpdateWithExperimental
testUpdateWithExperimental :: Spec
testUpdateWithExperimental = fdescribe "Update/Experimental" $ do
it "works" $ do
run $ do
p1k <- insert p1
updateRethrowingQuery $ \p -> do
(p0 :& p1) <- Experimental.from $
Table @Person
`InnerJoin`
Table @Person
`Experimental.on` do
\(p0 :& p1) ->
p0 ^. PersonName ==. p1 ^. PersonName
set p [ PersonName =. val "asdf" ]
where_ $ p0 ^. PersonName ==. p ^. PersonName
run, runSilent, runVerbose :: Run
runSilent act = runNoLoggingT $ run_worker act