https://github.com/jeremyjh/higher-leveldb
Haskell library that provides a rich monadic API on top of leveldb-haskell. Includes a simple but flexible scan/map/reduce mechanism as well as a monad transformer that manages the database context for you.
https://github.com/jeremyjh/higher-leveldb
haskell leveldb
Last synced: 17 days ago
JSON representation
Haskell library that provides a rich monadic API on top of leveldb-haskell. Includes a simple but flexible scan/map/reduce mechanism as well as a monad transformer that manages the database context for you.
- Host: GitHub
- URL: https://github.com/jeremyjh/higher-leveldb
- Owner: jeremyjh
- License: bsd-3-clause
- Created: 2013-09-01T02:16:36.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-03-18T12:47:42.000Z (about 5 years ago)
- Last Synced: 2024-05-08T20:52:04.606Z (12 months ago)
- Topics: haskell, leveldb
- Language: Haskell
- Homepage:
- Size: 56.6 KB
- Stars: 25
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Example
```Haskell
{-# LANGUAGE OverloadedStrings #-}
import Database.LevelDB.Highermain =
runCreateLevelDB "/tmp/mydb" "MyKeySpace" $ do
put "key:1" "this is a value"
put "key:2" "another value"
scan "key:" queryItems> [("key:1","this is a value"),("key:2","another value")])
```
## Summary
Higher LevelDB provides a rich monadic API for working with [leveldb] (http://code.google.com/p/leveldb) databases. It uses the leveldb-haskell bindings to the C++ library. The LevelDBT transformer is a Reader that maintains a database context with the open database as well as default read and write options. It also manages a concept called a KeySpace, which is a bucket scheme that provides a low (storage) overhead named identifier to segregate data. Finally it wraps a ResourceT which is required for use of leveldb-haskell functions.
The other major feature is the scan function and its ScanQuery structure that provides a map / fold abstraction over the Iterator exposed by leveldb-haskell.
Please refer to the [API docs](http://hackage.haskell.org/package/higher-leveldb-0.1.0.1/docs/Database-LevelDB-Higher.html) for more.