yesodweb / yesodweb/persistent
Provide better error message on `id` fields
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 486
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
Currently, if you define a model with an id field, like:
User
id UUID
Then persistent fails with an unhelpful error about Multiple declarations of of 'UserId'.
While persistent should support an id column, for now, we should fail with a better error message - guiding folks towards Id.
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 tracing how persistent handles model field declarations and reports duplicate declarations for a field named id. Confirm the behavior with the User id UUID example, then make the failure message guide users toward Id; done means this case no longer emits the unhelpful Multiple declarations of 'UserId' message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100