typelevel / typelevel/skunk

Query or SQL from case class?

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

Nobody has claimed this yet.

Dominant language
Scala
Stars
1.7k
Forks
175
Avg merge
5d 14h
Merged PRs (30d)
9

Description

Is it a bad idea to ask for a function that generates a Query or a SQL fragment from a case class? Can this be done at compile time?

If a column/table name differed from the case class field/class name some kind of annotation or maybe a mapping DSL could exist.

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 names no files, tests, or entry points and frames a compile-time case-class-to-query or SQL mapping as an open design question. Start by reviewing Skunk’s existing query and SQL-fragment APIs and how Scala case classes could map renamed columns or tables. Done would require an agreed scope and design, plus an implementation and tests if the feature is accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgres, scala
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.