Skip to content

Allow to traverse over crud.cfg using pairs() #265

Open
@DifferentialOrange

Description

@DifferentialOrange

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 tarantool/tarantool#4521, if you're interested.

Originally posted by @Totktonada in #244 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions