@kodebach wrote in #3223
Of course, if you just change your mind and say a storage format can limit Elektra's abilities the problem goes away. But that fundamentally changes Elektra's promise to users. We would limit all users just to allow some developer to safe a few lines of code dealing with encoding special values.
If it would be like this, it would be crazy to do so. But afaik it is not "a few lines of code" but basically all the complexity that storage plugins have (mini vs. toml). Yes, I do not think we should promise users that they can use any storage plugin without any problems. As we clearly see with even very highly evolved storage plugins like YAML and TOML (which used up hundreds of hours development time) this was a wrong promise to begin with.
@bauhaus93 @sanssecours Can you please comment? Is it realistic that storage plugins will be able to accept
Or said differently: where are the limitations? What can we really offer to applications to rely on?
Can we promise users that any storage plugin can be used for any application?
In general I think the suitability of a certain storage plugin for a certain task depends on
For the YAML file format I am pretty sure that we should be able to store every part of a KeySet structure without problems, if we do not care much about the mapping. In general: If you can map something into a graph without multi-edges (circles are fine) then you should be able to store it as YAML data.
However, the current YAML plugins most certainly do not support every possible KeySet. I am pretty sure, that support for most data should be possible though, if someone decides to invest more work into the plugins.
Note: For the following questions all my answers assume that we use YAML as storage format with the current hierarchical mapping.
Is it realistic that storage plugins will be able to accept
- any key name
If we assume that mixing array data and non-array data at the same level is possible, then no. For example, storing something like
{ "user:/array", KEY_META, "array", "#0" }
{ "user:/array/#0", KEY_VALUE, "something" }
{ "user:/array/name", KEY_VALUE, "some other thing" }
is not possible.
- any key value
Yes
- any valid key set structure (i.e. everything but arrays intermixed with non-arrays) including
- arbitrary holes
Yes
- values at arbitrary keys in the middle (i.e. non-leaf values with arbitrary names)
No
all types Elektra supports
In theory that should be possible.
Thank you very much for the answer!
Most helpful comment
No 馃槉
In general I think the suitability of a certain storage plugin for a certain task depends on
For the YAML file format I am pretty sure that we should be able to store every part of a
KeySetstructure without problems, if we do not care much about the mapping. In general: If you can map something into a graph without multi-edges (circles are fine) then you should be able to store it as YAML data.However, the current YAML plugins most certainly do not support every possible
KeySet. I am pretty sure, that support for most data should be possible though, if someone decides to invest more work into the plugins.Note: For the following questions all my answers assume that we use YAML as storage format with the current hierarchical mapping.
If we assume that mixing array data and non-array data at the same level is possible, then no. For example, storing something like
is not possible.
Yes
Yes
No
In theory that should be possible.