yesodweb / yesodweb/persistent
`upsertBy` does not work with a non-default Id
Open
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 486
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
The signature of upsertBy means it cannot be used by non-default Id.
Foo
Id Text
name Text
age Int
UniqueName name
If we write:
upsertBy (UniqueName name) Foo
{ fooName = name
, fooAge = 25
}
[ FooAge +=. 1
]
... then this will fail because the ID column is not specified.
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 by locating the upsertBy definition and its signature, then reproduce the provided Foo example with a non-default Id. Done means upsertBy can perform the update without requiring the default Id column to be specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100