$darkmode
Elektra 0.10.0
|
To make storage-plugins suitable for spec
they need to be able to store all the metadata as specified in METADATA.ini. Most file formats do not have support for that.
If metadata is merged from different namespaces, e.g., spec:
and user:
; metadata from one namespace might end up in keys of other namespaces, e.g.; metadata from spec:
might end up in user:
.
spec:/
to other namespace.ini
plugin: this exposes internal metadata into the comments and can drastically affect the readability of a storage file. Comments should never be touched by a parser.spec:/
or to only for restoring configuration file formats. Rename metadata <type>
in spec:/
to check/<type>
or make/array
. This way no merging of metadata would be needed and by the name alone it would be clear to which namespace it belongs.array
or type
if the underlying configuration file format does not support it. spec-mount
could make sure that the storage plugin supports everything the underlying format needs.Do not store metadata unrelated to the configuration file structure in any namespace except in spec:/
.
kdb set-meta user:/data metadata_not_suitable_for_storage_plugins something
would fail (validated by spec
plugin).comment
or order
, might be stored in any namespace.Sometimes, the same metadata can be used in several namespaces but with different meanings and ways of serialization, e.g. type
and array
:
spec:/
the metadata array=
(empty value) means "this is an array". If you give it a value e.g. array=#4
it means "this is an array with default size X" (e.g. #4
= size 5).array=
means "this is an empty array" and e.g. array=#4
means "this is an array with max index #4". array=#4
is not stored literally but inferred.kdbSet
but spec
will keep on adding it for every kdbGet
.spec
) and as such available in the next kdbGet
from the storage plugin to be validated by spec
.Use different storage plugins, or plugins with different configurations, for the spec:/
namespace:
ni
meta
configurationThe kdb mount
tool will add the meta
plugin configuration when mounting a storage plugin to spec:/
.
type
and array
can be used in specs.spec:/
than in the other namespaces.array
in spec:/
has a quite different meaning to array
in other namespaces.