tarantool / tarantool/crud

Support use_tomap everywhere

Open
#367 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2sp customer feature
Dominant language
Lua
Stars
43
Forks
17
Avg merge
28m
Merged PRs (30d)
2

Description

crud.pairs has use_tomap option allowing to return tuples as key-value maps instead of arrays, since there is no way to do unflatten_rows while calling pairs.

But this feature seems useful by itself. @WeCodingNow had reported that he uses crud.pairs():totable() instead of crud.select since it is impossible to write an oneliner that returns tuples as key-value maps with crud.select. There doesn't seem to be any harm in implementing use_tomap, so let's support it.

Contributor guide

No contributing guide indexed for this repository

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 locating the crud.pairs and crud.select entry points and the existing use_tomap option handling. Trace how pairs().totable() and unflatten_rows differ, then define the supported behavior for use_tomap across the relevant APIs. Done means crud.select can return tuples as key-value maps in the intended one-liner use case without breaking existing array results.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
backend-api-design, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.