yesodweb / yesodweb/persistent
Version of repsert for records with custom primary keys
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 486
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
The type of repsert is (MonadIO m, PersistRecordBackend record backend) => Key record -> record -> ReaderT backend m (), if I have a record where I've specified the key is one of the fields then the first parameter is redundant - it can be computed from the record itself. It'd be a nice ergonomic improvement to have a function for that case with one less parameter. It'd be almost exactly the same as upsert, with the OnlyOneUniqueKey constraint, but not taking a list of updates to perform.
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
Read the existing repsert and upsert definitions, along with the OnlyOneUniqueKey constraint, to understand their current API and backend behavior. Done means providing a repsert variant that derives the key from the record and performs the operation without an update list, while preserving the existing constraints and behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- database
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100