Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 73 lines (50 sloc) 1.708 kB
5975fd7 @wmorgan update README and add LICENSE
authored
1 LevelDB is a very fast, persistent, in-process key-value store.
2 Read more about it here: http://code.google.com/p/leveldb/.
63e6edb @wmorgan initial version
authored
3
5975fd7 @wmorgan update README and add LICENSE
authored
4 This gem contains Ruby bindings so that you can use it from your
5 Ruby process.
63e6edb @wmorgan initial version
authored
6
5975fd7 @wmorgan update README and add LICENSE
authored
7 INSTALLATION
63e6edb @wmorgan initial version
authored
8
5975fd7 @wmorgan update README and add LICENSE
authored
9 gem install leveldb-ruby
63e6edb @wmorgan initial version
authored
10
5975fd7 @wmorgan update README and add LICENSE
authored
11 SYNOPSIS
63e6edb @wmorgan initial version
authored
12
5975fd7 @wmorgan update README and add LICENSE
authored
13 require 'rubygems' # on for ruby 1.8
63e6edb @wmorgan initial version
authored
14 require 'leveldb'
15
5975fd7 @wmorgan update README and add LICENSE
authored
16 ## make a new database
48029be @stevewilhelm fixed README example
stevewilhelm authored
17 db = LevelDB::DB.new "/tmp/asdf"
63e6edb @wmorgan initial version
authored
18
5975fd7 @wmorgan update README and add LICENSE
authored
19 ## getting and setting
20 db.put "it", "works" # => "works"
21 db.get "it" # => "works"
22
23 db["hello"] = "there" # => "there"
24 db["hello"] # => "there"
25
26 db["nonexistent"] # => nil
27
28 ## testing
29 db.includes? "hello" # => true
30 db.contains? "hello" # => true
31
32 ## keys and values
33 db.keys # => "it", "hello"
34 db.values # => "there", "works"
35
36 ## iterating
37 db.each { |k, v| ... }
38 db.map { |k, v| ... }
39 db.each # => LevelDB::Iterator
40
41 ## ranges
42 db.each(:from => "a", :to => "b") # => LevelDB::Iterator
43 db.each(:from => "a", :to => "b").
44 map { |k, v| ... }
45 # etc...
46
47 ## deleting
48 db.delete "hello" # => "there"
49 db.delete "hello" # => nil
50
51 LICENSE
52
53 Leveldb-ruby is available for your use under the terms of
54 the New BSD License. See the LICENSE file for details.
55
56 CREDIT
57
58 This gem brought to you by William Morgan <http://masanjin.net/>
59 and the following honorable contributors:
60 - Rick Olson
61 - byplayer
62 - Yukio Goto
63 - Johannes Holzfuß
64 - Steve Wilhelm
65 - Gabriel Ebner
66 and by users like you.
67
68 BUGS
0ed2f71 @wmorgan minor readme update
authored
69
5975fd7 @wmorgan update README and add LICENSE
authored
70 Please report bugs to https://github.com/wmorgan/leveldb-ruby/issues.
0ed2f71 @wmorgan minor readme update
authored
71
72
Something went wrong with that request. Please try again.