Add a type-unsafe Dynamic-based DSL for highly dynamic query construction
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 2.2k
- Forks
- 379
- Avg merge
- 14m
- Merged PRs (30d)
- 8
Description
doobie excels at sql whose syntax structure is relatively static, but if you need to dynamically change what tables are joined on, embed queries as subqueries, etc, it doesn't offer any DSL that makes it reasonable. Fragments make it possible but at that point you're doing glorified string concatenation.
A fully type safe AST DSL quickly becomes untenable to type statically, so I think a Dynamic based one that eschews type safety is a good trade off -- highly dynamic sql structure means that the sql is performing complex logic, meaning that the tests you will have to write to cover the logic should cover a large portion of the syntax safety.
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
The issue proposes a Dynamic-based DSL for highly dynamic SQL, including changing joined tables and embedding subqueries. Start by reviewing the existing Fragment approach and determine the DSL's scope and API; done would mean dynamic query structure is expressible without relying on glorified string concatenation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100