typelevel / typelevel/skunk

Extending the sql interpolator?

Open
#978 0 comments 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

Hi,

I'm writing a small wrapper for skunk. I've created a type that encapsulates a column name and it's codec. I want to put an instance of that type into sql"..." and want it to be interpreted as a fragment with that column name. As far as I understand, it won't work as macro implementation of sql operates on a closed set of classes and hence, supplying implicit conversion won't help.

Are there any ways to achieve that without writing own interpolator? Maybe it'd be possible to extend the macro to either accept implicit conversions or maybe a type that has a method like toSqlFragment that would be open to extension?

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

Start by reading Skunk's SQL interpolator macro implementation, which the issue identifies as accepting only a closed set of classes. Determine whether an extension mechanism is intended; the issue does not name files or tests, and completion criteria remain undecided between implicit conversions and a toSqlFragment-style API.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgres, scala, sql
Domain
backend-api-design, databases
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.