kv
Key-value store abstraction: in-memory, TTL, namespaces, persistence.
Load with: use kv
Quick example
use kv
result = kvns("value", 10)
prn(result)
Functions
Functions
kvnew()
Performs the operation.
kvns(s, ns)
Performs the operation. Takes s, ns.
kvk(s, key)
Performs the operation. Takes s, key.
kvset(s, key, val, ttl)
Performs the operation. Takes s, key, val, ttl.
kvget(s, key)
Performs the operation. Takes s, key.
kvhas(s, key)
Performs the operation. Takes s, key.
kvdel(s, key)
Performs the operation. Takes s, key.
kvclr(s)
Performs the operation. Takes s.
kvkys(s)
Performs the operation. Takes s.
kvsz(s)
Returns the size or count. Takes s.
kvttl(s, key)
Performs the operation. Takes s, key.
kvexp(s)
Performs the operation. Takes s.
kvinc(s, key, n)
Performs the operation. Takes s, key, n.
kvmgt(s, keys)
Performs the operation. Takes s, keys.
kvmst(s, pairs)
Sets a value or starts a process. Takes s, pairs.
Module aliases
These are the public-facing names you call with use kv:
kv.new()kv.ns(s, n)kv.set(s, k, v, t)kv.get(s, k)kv.has(s, k)kv.del(s, k)kv.clr(s)kv.kys(s)kv.sz(s)kv.ttl(s, k)kv.exp(s)kv.inc(s, k, n)
Notes
- Key-value store - in-memory, with optional persistence.