andreabedini / wiredtiger-haskell

Haskell bindings for the WiredTiger library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WiredTiger Haskell binding (unofficial)

This library is in very early stages.

Why

There are not many key-value store libraries available for Haskell. This is an attempt to make one. Also, for learning.

Note

From the docs.

Cursor key/value memory scoping

When applications pass a pointer (either to a WT_ITEM or a string), to WT_CURSOR::set_key or WT_CURSOR::set_value, WiredTiger does not copy the memory referenced by the pointer. For this reason, the application must keep the referenced memory unchanged and valid until the next operation that successfully positions the cursor, modifies the underlying data, or the cursor is reset or closed (discarding its resources). The operations that position the cursor are WT_CURSOR::next, WT_CURSOR::prev, WT_CURSOR::search and WT_CURSOR::search_near; the operations that modify the underlying data are WT_CURSOR::insert, WT_CURSOR::update and WT_CURSOR::remove.

If a cursor operation fails (for example, due to a WT_ROLLBACK error), it may be retried without calling WT_CURSOR::set_key or WT_CURSOR::set_value again. That is, the cursor may still reference the application-supplied memory until the cursor is successfully positioned, underlying data is modified, or the cursor is closed or reset.

Any pointers returned by WT_CURSOR::get_key or WT_CURSOR::get_value are only valid until a subsequent cursor call that successfully positions the cursor, modifies the underlying data, or the cursor is reset or closed. These pointers may reference private WiredTiger data structures that may not be modified or freed by the application. If a longer scope is required, the application must make a copy of the memory before the cursor is re-used, closed or reset.

About

Haskell bindings for the WiredTiger library

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Haskell 100.0%