yesodweb / yesodweb/persistent

Identify mismatches between `sqltype` and Haskell type at compile time

Open
#731 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.