Allow to traverse over crud.cfg using pairs()

Open
#265 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
lua
Domain
backend

Research direction

Start by reading issue #244 and the referenced discussion in pull request #244, then review the related thoughts in Tarantool issue #4521. The issue presents several possible APIs for traversing or copying crud.cfg without selecting one, so completion requires an agreed design and corresponding documentation or behavior.

Written by the indexing model from the issue text.

Description

feature

Follows up #244

Unlike pairs(box.cfg), pairs(crud.cfg) will now work. Not really a bit deal, since here we have no backward compatibility guarantees.

However maybe it worth to add crud.cfg:pairs() and mention it in the documentation: just to don't let users write a wrong code with pairs(crud.cfg) or fun.iter(crud.cfg). Or add crud.cfg:unwrap(), which returns a pure table. Or crud.cfg:copy(), which returns a copy. Don't know.

Maybe it is not needed for anyone. OTOH, using fun.chain() to merge several configs is quite useful. Say, when you have a default one, one collected from env and one provided in arguments. But whether we can need a current config is such chains? Don't know.

Let's ignore it for now. It is not critical.

I also added some more thoughts into https://github.com/tarantool/tarantool/issues/4521, if you're interested.

Originally posted by @Totktonada in https://github.com/tarantool/crud/pull/244#discussion_r811481219

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

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.

More from tarantool/crud

All issues in tarantool/crud

Similar issues

More Lua issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.