yesodweb / yesodweb/persistent
`upsertWhere` in `Database.Persist.Postgresql` has too strict a type signature
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 486
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
The constraints for upsertWhere are as follows:
( backend ~ PersistEntityBackend record
, PersistEntity record
, PersistEntityBackend record ~ SqlBackend
, MonadIO m
, PersistStore backend
, BackendCompatible SqlBackend backend
, OnlyOneUniqueKey record
) =>
But as you might notice, it's saying BackendCompatible SqlBackend backend AND backend ~ SqlBackend (via a small detour using PersistEntityBackend record).
So it's basically just saying the backend HAS to be SqlBackend. I believe this should be able to be loosened (so we can use our own backend)
At first glance, I think the backend ~ PersistEntityBackend record is the only unnecessary constraint. 🤔
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at upsertWhere in Database.Persist.Postgresql and trace how PersistEntityBackend, SqlBackend, and BackendCompatible constrain the function. Confirm the intended custom-backend use and update coverage so the signature permits it without forcing backend ~ SqlBackend.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell, postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100