-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkvstore.nim
More file actions
31 lines (28 loc) · 782 Bytes
/
kvstore.nim
File metadata and controls
31 lines (28 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
## nim-kvstore - Unified API for multiple key-value stores
##
## Basic usage with raw bytes:
## .. code-block:: Nim
## import pkg/kvstore
## import pkg/stew/byteutils
##
## let ds = SQLiteKVStore.new(SqliteMemory).tryGet()
## let key = Key.init("/users/alice").tryGet()
##
## # Store data
## (await ds.put(key, "Hello".toBytes())).tryGet()
##
## # Retrieve data
## let record = (await ds.get(key)).tryGet()
## echo string.fromBytes(record.val)
##
## For typed records with automatic encoding/decoding, also import:
## .. code-block:: Nim
import pkg/chronos
import pkg/questionable/results
import ./kvstore/key
import ./kvstore/api
import ./kvstore/fsds
import ./kvstore/sql
import ./kvstore/types
import ./kvstore/query
export api, fsds, sql, types, query, key