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:
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 dbSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
name | str |
Returns
Errors
KvError@error
Effects
db
Defined in: std/kv/kv.oxl:352