OxL Reference

method Kv.open

Opens (creates) the store name; "name?shards=4" (or $OXL_KV_SHARDS) sets the number of shards (default 1). Handles on the same name share the data.

Example:

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

fn main() io, db {
  let kv = Kv.open("example")!
  kv.put("k", Utf8.encode("v"))!
  print("{kv.get("k") is none}")
  kv.close()
}
Output
false
pub(api) static fn open(name: str) -> Kv | KvError  db

Since. 1.0.0-beta

Parameters

NameType
namestr

Returns

Kv

Errors

Effects

db

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

See also