OxL Reference

method KvTx.delete

Removes key when the transaction commits.

Example:

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

fn main() io, db {
  let kv = Kv.open("docs-kvtxdel")!
  kv.put("k", b"v")!
  let _ = kv.txn(tx => {
    tx.delete("k")
  })
  match kv.get("k") {
    bytes _ => print("still there")
    none => print("gone")
    KvError _ => print("error")
  }
  kv.close()
}
Output
gone
pub(api) fn delete(key: str)

Since. 1.0.0-beta

Parameters

NameType
keystr

Effects

none declared (pure unless the body says otherwise)

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

See also