This is short for ordered set and functionally similar to Redis' HSET.
Currently, in order to set up an ordered key, you have to do something like this because tandems clear the value region on setup:
SHUNT() {
SET "${1}" " "
splinterpctl orders set "${1}" 2
SET "${1}" "${2}"
TYPE "${1}" vartext
TYPE "${1}.1" json
LABEL "${1}" "shunt-attractor"
}
Note that I first have to set an empty key, then call orders to create a tandem, then actually set the key (because orders will clear the value). This should be a single call in the API and CLI as splinter_oset(key, value, orders_to_setup) and oset orders_to_setup value in the CLI.
Likewise, it should be harder to wipe out a key accidentally with orders, so have it fail on non-empty (more than 1 byte long) keys unless -f / --force is passed.
May need to integrate argparse with orders.
This is short for
ordered setand functionally similar to Redis'HSET.Currently, in order to set up an ordered key, you have to do something like this because tandems clear the value region on setup:
Note that I first have to set an empty key, then call
ordersto create a tandem, then actually set the key (becauseorderswill clear the value). This should be a single call in the API and CLI assplinter_oset(key, value, orders_to_setup)andoset orders_to_setup valuein the CLI.Likewise, it should be harder to wipe out a key accidentally with
orders, so have it fail on non-empty (more than 1 byte long) keys unless-f / --forceis passed.May need to integrate argparse with orders.