yesodweb / yesodweb/persistent

New parser has differing behavior on quoted attributes

Open
#1,599 2 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

Surfaced in https://github.com/commercialhaskell/curator/issues/52#issuecomment-3002214345

This is a weird one - the stack repository has a definition that looks like this:

share [ mkPersist sqlSettings
      , mkMigrate "migrateAll"
      ]
      [persistLowerCase|
PrecompiledCacheParent sql="precompiled_cache"
  platformGhcDir FilePath "default=(hex(randomblob(16)))"
  compiler Text
  cabalVersion Text
  packageKey Text
  optionsHash ByteString
  haddock Bool default=0
  library FilePath Maybe
  UniquePrecompiledCacheParent platformGhcDir compiler cabalVersion packageKey optionsHash haddock sql="unique_precompiled_cache"
  deriving Show

The platformGhcDir FilePath "default=(hex(randomblob(16)))" line is strange. I'm not sure how this would have parsed in the old parser or been used, but the new one properly parses but fails to generate the right code.

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 reading the example definition in Stack/Storage/User.hs around line 100 and trace how the persistent parser handles the quoted attribute. Compare the generated code for this declaration with the expected behavior; the issue does not name a parser source file or test, so those entry points must be located first.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.