Conversation
| , parseEntityValues | ||
| , parseExistsResult | ||
| , updatePersistValue | ||
| ) |
There was a problem hiding this comment.
imports diff here was just stylish-haskell, aside from adding parseExistsResult on line 27
|
CI is failing with a bunch of which looks like it's the I wonder, if I hadn't edited anything in |
parsonsmatt
left a comment
There was a problem hiding this comment.
Let's put a default impl on the class so it's a safer for backwards compatibility
| ## 2.14.4.4 | ||
|
|
||
| * [#1460] https://github.com/yesodweb/persistent/pull/1460 | ||
| * [#1460](https://github.com/yesodweb/persistent/pull/1460) |
There was a problem hiding this comment.
This matches the format in the rest of the changelog, where the PR number links to the link, but the URL itself is not shown. I can revert these changes if you want.
There was a problem hiding this comment.
That's great - thank you!
parsonsmatt
left a comment
There was a problem hiding this comment.
This looks great, thank you so much!
| ## 2.14.4.4 | ||
|
|
||
| * [#1460] https://github.com/yesodweb/persistent/pull/1460 | ||
| * [#1460](https://github.com/yesodweb/persistent/pull/1460) |
There was a problem hiding this comment.
That's great - thank you!
This adds
existsByinPersistUniqueRead, as a more efficient version ofisJust <$> getBy uniq.The intent is to provide an (a) more convenient to type and (b) more efficient way to query existence of a row by unique key.
The SQL is a combination of the
existsandgetByimpls, and looks likeSELECT EXISTS (SELECT 1 FROM ...constraints...).The performance difference shouldn't be large, but conceivably on wider tables (or with heavy columns eg. JSON or binary blobs),
existsBywould require less serialization (just a single response column) and may allow the query planner to do an index-only plan.What do you think?
Before submitting your PR, check that you've:
@sincedeclarations to the Haddockstylish-haskellon any changed files..editorconfigfile for details)After submitting your PR:
(unreleased)on the Changelog