typelevel / typelevel/doobie

Add a type-unsafe Dynamic-based DSL for highly dynamic query construction

Open
#561 1 comment 0 reactions 0 assignees View on GitHub

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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.