crystal-lmdb
所属分类:工具库
开发工具:Crystal
文件大小:0KB
下载次数:0
上传日期:2020-04-07 08:37:15
上 传 者:
sh-1993
说明: Lightning Memory Mapped Database(LMDB)的水晶包装器,
(Crystal wrapper for the Lightning Memory-Mapped Database (LMDB),)
文件列表:
LICENSE (1086, 2020-04-07)
examples/ (0, 2020-04-07)
examples/bm.cr (1917, 2020-04-07)
examples/map.cr (506, 2020-04-07)
examples/multimap.cr (647, 2020-04-07)
examples/simple.cr (816, 2020-04-07)
shard.yml (135, 2020-04-07)
spec/ (0, 2020-04-07)
spec/spec_helper.cr (37, 2020-04-07)
spec/value_spec.cr (2794, 2020-04-07)
src/ (0, 2020-04-07)
src/lmdb.cr (1084, 2020-04-07)
src/lmdb/ (0, 2020-04-07)
src/lmdb/cursor.cr (12399, 2020-04-07)
src/lmdb/database.cr (14550, 2020-04-07)
src/lmdb/disposable.cr (493, 2020-04-07)
src/lmdb/environment.cr (11055, 2020-04-07)
src/lmdb/error.cr (1066, 2020-04-07)
src/lmdb/lib_lmdb.cr (6349, 2020-04-07)
src/lmdb/transaction.cr (3805, 2020-04-07)
src/lmdb/types.cr (4740, 2020-04-07)
# crystal-lmdb
Crystal wrapper around the Lightning Memory-Mapped Database ([LMDB](https://symas.com/lmdb/)).
LMDB is a fast embedded transactional database with the following properties:
- Key/value store.
- Ordered map interface (keys are lexicographically sorted).
- Reader/writers transactions that don't block each other.
- ACID compliant, with nested transactions.
This wrapper tries to add as little overhead as possible, by avoiding copy and allocations whenever possible.
## Installation
### Requirements
- Install [LMDB](https://symas.com/lmdb/) >= 0.9.23 on your system and makes sure the library can be found by the linker.
### Shard
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
lmdb:
github: rumenzu/crystal-lmdb
version: 0.1.0
```
2. Run `shards install`
## Usage
```crystal
require "lmdb"
LMDB.open("./tmp/simpledb") do |env|
env.transaction do
env.open_db do |db|
db.put('a', 'a'.ord)
db.put('b', 'b'.ord)
db.put('c', 'c'.ord)
end
end
end
```
See also the `examples` folder.
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [Romain Franceschini](https://github.com/RomainFranceschini) - creator and maintainer
近期下载者:
相关文件:
收藏者: