yesodweb / yesodweb/persistent
Per entity field prefix?
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 486
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
I found out about mpsPrefixFields setting, making it possible to control prefixing of fields with entity name. I wonder if its possible to prefix field accessors / lenses, per entity, with something else than entity name? Ive a bunch of types with accessors prefixed by "_" <acronym> "_". Like User's "name" field is _u_name and GameLog "command" field is _gl_command.
...and keep sql column names and json fields use the non prefixed names. Ie. if ive provided "name" in my record descripton that will be used, as is, for sql and json.
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 reading the existing mpsPrefixFields setting and how entity field accessors or lenses are generated. Define how a per-entity accessor prefix would work while keeping the record description's names unchanged for SQL columns and JSON fields.
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
- Needs clarification
- Newbie friendliness
- 25/100