yesodweb / yesodweb/persistent

Allow customization of the Haskell name

Open
#1,568 0 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 popped up at work. We have a database table that is being replicated across two databases. Converting that table to mpsGeneric would be a huge PITA, and we don't want to do it, so instead we're going to read the same .persistentmodels file twice - once for the main DB and once for the replicated DB.

While this will do the right thing, the generated type will be identical namewise, and this may be confusing. We'd like to customize the name of the Haskell datatype, similar to how we customize the name of the SQL table.

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

Start by tracing how the .persistentmodels file is read and how the Haskell datatype name is generated, comparing it with the existing SQL table-name customization. The work is done when separate reads can assign distinct Haskell datatype names while preserving the existing table mapping behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.