-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathREADME
72 lines (50 loc) · 1.67 KB
/
README
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
LevelDB is a very fast, persistent, in-process key-value store.
Read more about it here: http://code.google.com/p/leveldb/.
This gem contains Ruby bindings so that you can use it from your
Ruby process.
INSTALLATION
gem install leveldb-ruby
SYNOPSIS
require 'rubygems' # on for ruby 1.8
require 'leveldb'
## make a new database
db = LevelDB::DB.new "/tmp/asdf"
## getting and setting
db.put "it", "works" # => "works"
db.get "it" # => "works"
db["hello"] = "there" # => "there"
db["hello"] # => "there"
db["nonexistent"] # => nil
## testing
db.includes? "hello" # => true
db.contains? "hello" # => true
## keys and values
db.keys # => "it", "hello"
db.values # => "there", "works"
## iterating
db.each { |k, v| ... }
db.map { |k, v| ... }
db.each # => LevelDB::Iterator
## ranges
db.each(:from => "a", :to => "b") # => LevelDB::Iterator
db.each(:from => "a", :to => "b").
map { |k, v| ... }
# etc...
## deleting
db.delete "hello" # => "there"
db.delete "hello" # => nil
LICENSE
Leveldb-ruby is available for your use under the terms of
the New BSD License. See the LICENSE file for details.
CREDIT
This gem brought to you by William Morgan <http://masanjin.net/>
and the following honorable contributors:
- Rick Olson
- byplayer
- Yukio Goto
- Johannes Holzfuß
- Steve Wilhelm
- Gabriel Ebner
and by users like you.
BUGS
Please report bugs to https://github.com/wmorgan/leveldb-ruby/issues.