store_key - Store one or several key-value pairs in the database.
true or false
store_key( argtbl or [key, val], opttgt, optcfg )
There are multiple key- value stores that can be used for keeping track of
specific key value pairs. The default one is bound to the currently running
appl, but there is also one connected to each execution target that can be
accessed by setting opttgt to any value returned from calling
list_targets . There is also an execution target configuration specific
key- value store if both opttgt and optcfg are set to a valid
target- configuration pair. Only characters in the set [a-Z][0-9]_/+= are
valid key values.
- 1
- The /+= are allowed to support base64 encoded values.
- 2
- If the string length of a value field is set to 0, the key will be
deleted. To set multiple pairs at once, pack them in a key- indexed
table.
function store_key0()
tbl = {key_a = "ok", key_b = "ok"};
store_key(tbl);
store_key("key_c", "ok");
print(get_key("key_a"));
print(get_key("key_b"));
print(get_key("key_c"));
local tgtlist = list_targets();
if (#tgtlist > 0) then
store_key(tbl, tgtlist[1]);
store_key(tbl, tgtlist[1], target_configurations(tgtlist[1])[1]);
end
end
get_key(3) match_keys(3) list_targets(3)
target_configurations(3)