OxL Reference

method KvTx.put

Stores value under key when the transaction commits.

Example:

oxl✓ checked in CI
use std.kv { Kv }

fn main() io, db {
  let kv = Kv.open("docs-kvtxput")!
  let _ = kv.txn(tx => {
    tx.put("k", b"v")
  })
  print("{kv.get("k")!.len()}")
  kv.close()
}
Output
1
pub(api) fn put(key: str, value: bytes)

Since. 1.0.0-beta

Parameters

NameType
keystr
valuebytes

Effects

none declared (pure unless the body says otherwise)

Defined in: std/kv/kv.oxl:701

See also