yesodweb / yesodweb/persistent
Question marks inside of strings cause RawSQL to be sad
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 486
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
Suppose you're in a dark room and you're not sure who you're interacting with
[sqlQQ| SELECT 'hello world?' |]
This gives a FormatError because we're trying to split on the ?, even though the ? is not a parameter to substitute syntactically, but a character in the string.
We can work around this by providing the value as a query parameter:
[sqlQQ| SELECT #{PersistText "hello world?"} |]
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 reproducing the issue with the shown sqlQQ example containing SELECT 'hello world?', then trace the SQL quasiquoter's parameter-splitting logic. Done means question marks inside quoted strings no longer cause a FormatError while substitution still works for actual parameters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100