table of contents
- NAME
- Add a key value pair to the database
- The Tcl plugin also supports metadata
- A known limitation of the plugin is that it discards whitespace characters
- Undo modifications
- Mount plugin
- Import some data
- Take a look at imported data
- The plugin supports binary data…
- … and empty keys
- Undo modifications
| md_src_plugins_tcl_README(3elektra) | Elektra | md_src_plugins_tcl_README(3elektra) |
NAME¶
md_src_plugins_tcl_README - Plugin: tcl
- infos = Information about the tcl plugin is in keys below
- infos/author = Markus Raab elektra@libelektra.org
- infos/licence = BSD
- infos/provides = storage/tcl
- infos/needs = code null binary
- infos/placements = setstorage getstorage
- infos/status = unfinished concept
- infos/description = Serialize tcl lists
This plugin is a storage plugin which writes keys to lists in the style of the Tcl programming language.
Format¶
The format does not have significant spaces. The advantage of TCL style lists is that also arbitrary metadata can be embedded in a natural and distinguish-able style. It looks like:
{
{
key=val
{
metakey = b
}
{
comment = huhu
}
}
}
Basic Usage¶
`` <h1>Mount Tcl plugin to namespaceuser/examples/tcl` sudo kdb mount config.tcl user/examples/tcl tcl
Add a key value pair to the database¶
kdb set user/examples/tcl/key value
The Tcl plugin also supports metadata¶
kdb setmeta user/examples/tcl/key comment 'This key contains example data.'
A known limitation of the plugin is that it discards whitespace characters¶
kdb getmeta user/examples/tcl/key comment #> Thiskeycontainsexampledata.
kdb export user/examples/tcl tcl #> { #> { #> user/examples/tcl/key = value #> { #> comment = Thiskeycontainsexampledata. #> } #> } #> }
Undo modifications¶
kdb rm -r user/examples/tcl sudo kdb umount user/examples/tcl
## Binary Data The plugin also supports binary data via the [base64 plugin](@ref src_plugins_base64_README_md) and null keys via the [null plugin](@ref src_plugins_null_README_md).
Mount plugin¶
sudo kdb mount config.tcl user/tests tcl
Import some data¶
kdb import user/tests/dump xmltool < src/plugins/xmltool/xmltool/dump.xml
Take a look at imported data¶
kdb ls user/tests/dump #> user/tests/dump/.HiddenBinaryKey #> user/tests/dump/.HiddenDirectoryKey #> user/tests/dump/.HiddenStringKey #> user/tests/dump/PerfectBinaryKey #> user/tests/dump/PerfectDirectoryKey #> user/tests/dump/PerfectStringKey #> user/tests/dump/Ug.ly:Bin €ryKey #> user/tests/dump/Ug.ly:Dir€oryKey #> user/tests/dump/Ug.ly:St€n.gKey
The plugin supports binary data…¶
kdb get user/tests/dump/PerfectBinaryKey #>
… and empty keys¶
kdb get user/tests/dump/Ug.ly:Bin €ryKey
Undo modifications¶
kdb rm -r user/tests sudo kdb umount user/tests ```
Limitations¶
- whitespaces are discarded
- no comments
Dependencies¶
- •
- libboost-dev
| Mon Jan 15 2018 | Version 0.8.20 |