yesodweb / yesodweb/persistent
Identify mismatches between `sqltype` and Haskell type at compile time
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 486
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
This question was posted on Reddit. The brief summary was:
The problem is that persistent doesn't know how to turn a value of type PersistDbSpecific to a value of type Text. The persistent wiki shows what values persistent can marshal between out of the box, and the PostgreSQL value of citext is not on that list.
It should be possible to move this into a compile-time error instead of a run-time error. That would improve ergonomics of the library -- "Failed to generate schema: SqlType and HaskellType are incompatible. Consider writing a newtype and an instance of PersistField and PersistFieldSql."
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
The issue names no files, tests, or entry points. Begin by tracing schema generation and the existing SqlType/HaskellType compatibility handling, then determine how compile-time validation fits the library's type machinery. Done means incompatible combinations fail at compile time with the stated guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100