Conversation
|
|
||
| ## 2.11.0 | ||
|
|
||
| * Naive implementation of `exists`function from `PersistQueryRead` type class using `count`. |
There was a problem hiding this comment.
| * Naive implementation of `exists`function from `PersistQueryRead` type class using `count`. | |
| * Naive implementation of `exists` function from `PersistQueryRead` type class using `count`. [#1070](https://github.com/yesodweb/persistent/pull/1070/files) |
|
|
||
| * [#1060](https://github.com/yesodweb/persistent/pull/1060) | ||
| * The QuasiQuoter now supports `OnDelete` and `OnUpdate` cascade options. | ||
| * [#1069](https://github.com/yesodweb/persistent/pull/1070) |
There was a problem hiding this comment.
Is this 1069/1070 mismatch intentional?
There was a problem hiding this comment.
(This also applies to the other changelog files)
There was a problem hiding this comment.
I think I somehow came to the conclusion that the first is the issue number while the second is the PR, but I'll change it to the PR everywhere.
| withRawQuery sql (getFiltsValues conn filts) $ do | ||
| mm <- CL.head | ||
| case mm of | ||
| Just [PersistBool b] -> return b |
There was a problem hiding this comment.
| Just [PersistBool b] -> return b | |
| Just [PersistBool b] -> return b -- Postgres |
| mm <- CL.head | ||
| case mm of | ||
| Just [PersistBool b] -> return b | ||
| Just [PersistInt64 i] -> return $ i > 0 |
There was a problem hiding this comment.
| Just [PersistInt64 i] -> return $ i > 0 | |
| Just [PersistInt64 i] -> return $ i > 0 -- MySQL, SQLite | |
| -- The following haven't been tested, but this is based off the code used in count |
| Just xs -> error $ "count:invalid sql return xs["++show xs++"] sql["++show sql++"]" | ||
| Nothing -> error $ "count:invalid sql returned nothing sql["++show sql++"]" |
There was a problem hiding this comment.
| Just xs -> error $ "count:invalid sql return xs["++show xs++"] sql["++show sql++"]" | |
| Nothing -> error $ "count:invalid sql returned nothing sql["++show sql++"]" | |
| Just xs -> error $ "PersistQuery.exists: Expected a boolean, int, double, or bytestring; got: " ++ show xs ++ " for query: " ++ show sql | |
| Nothing -> error $ "PersistQuery.exists: Expected a boolean, int, double, or bytestring; got: Nothing for query: " ++ show sql | |
|
This looks good to me, made a few suggested changes |
|
@limick Would you mind applying the relevant suggestions? Should be doable from the web editor. THen we can get this merged in and released 😄 |
|
Sure, thanks for your patience. |
This addresses #1069 by adding an
existsfunction to thePersistQueryReadtype class, which already provides thecountfunction. Thecountfunction will be used for a fallback implementation for backends that don't provide a separate existence check.Before submitting your PR, check that you've:
@sincedeclarations to the HaddockAfter submitting your PR: