Support for noop commands
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 1.7k
- Forks
- 175
- Avg merge
- 5d 14h
- Merged PRs (30d)
- 9
Description
Let's say we have a command builder doList of type (xs: List[A]) => Command[xs.type] defined as an sql"INSERT INTO [...] VALUES ${enc.values.list(xs)}" where enc is of type Encoder[A]. This command will succeed so long the input list is non-empty. If it's empty it will fail with a syntax error on the empty list of tuples().
I am trying to handle the empty case within the definition of doList, so that we don't have to bother to check for it on the caller's side. As far as I am aware, there seems to be no no-op command in postgresql. Using dummy selector commands like SELECT NULL doesn't work with Skunk since these return results and are therefore understood as queries.
Would it be advisable to add some sort of singleton type no-op command of type Command[Void] to Skunk and interpret it as sending nothing down the wire to postgresql?
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
Start with the doList example and the proposed Command[Void] no-op behavior, then read Skunk's distinction between commands and queries and how PostgreSQL handles empty command input. There are no files or tests named in the issue; done would require an agreed API and behavior for empty lists, plus coverage demonstrating the resulting command handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, scala
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100