Skip to content

mosquito/lsm-db-extras

Repository files navigation

lsm-db-extras

Coveralls Drone CI Latest Version

Thread/Process safe shelves and other lam-db helpers

Installation

pip install lsm-db-extras

Usage example

from lsm_extras import Shelf, LSMDict, LSMTree

with Shelf("/tmp/test.ldb") as shelf:
    shelf["foo"] = True


with Shelf("/tmp/test.ldb") as shelf:
    print(shelf["foo"])


with LSMDict("/tmp/test-dict.ldb") as storage:
    storage[1] = True


with LSMDict("/tmp/test-dict.ldb") as storage:
    print(storage[1])


with LSMTree("/tmp/test-tree.ldb") as storage:
    with tree.transaction():
        for i in range(10):
            tree['numbers', i] = i * 2
            tree['strings', i] = str(i)

    print(list(tree.find('strings')))

Releases

No releases published

Packages

No packages published

Languages