typelevel / typelevel/doobie

Define my own interpolator

Open
#794 2 comments 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

Hi, I really like Doobie, good work!

But I would like to define my own interpolator. In particular I was considering to:

  1. Allow variables anywhere in the query, and use ?$ for the variables that need to be replaced with ? (just reading the last character in the previous fragment), this should allow using variables for table names, if I'm not mistaken
  2. Have a default transactor in the same class where the interpolator is defined to execute the ConnectionIO into a Future with the results.

I was trying to use all the Doobie goodies for execution of the queries, type conversion, etc. But you are very clever and I can barely understand your code 😅

Is there any way to not use the sql interpolator but use the Doobie API directly? I have probably read the relevant code, but I cannot find a way to use it.

Thank you!

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 request centers on Doobie's SQL interpolator and direct Doobie API; start by tracing the interpolator and the API used to execute ConnectionIO. Determine whether custom interpolation, variables in arbitrary query positions, and a default transactor are supported, and document the supported path or the required design decisions.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala, sql
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.