Skip to content
This repository
Newer
Older
100644 70 lines (50 sloc) 1.708 kb
5975fd7a »
2012-03-12 update README and add LICENSE
1 LevelDB is a very fast, persistent, in-process key-value store.
2 Read more about it here: http://code.google.com/p/leveldb/.
63e6edbb »
2011-06-16 initial version
3
5975fd7a »
2012-03-12 update README and add LICENSE
4 This gem contains Ruby bindings so that you can use it from your
5 Ruby process.
63e6edbb »
2011-06-16 initial version
6
5975fd7a »
2012-03-12 update README and add LICENSE
7 INSTALLATION
63e6edbb »
2011-06-16 initial version
8
5975fd7a »
2012-03-12 update README and add LICENSE
9 gem install leveldb-ruby
63e6edbb »
2011-06-16 initial version
10
5975fd7a »
2012-03-12 update README and add LICENSE
11 SYNOPSIS
63e6edbb »
2011-06-16 initial version
12
5975fd7a »
2012-03-12 update README and add LICENSE
13 require 'rubygems' # on for ruby 1.8
63e6edbb »
2011-06-16 initial version
14 require 'leveldb'
15
5975fd7a »
2012-03-12 update README and add LICENSE
16 ## make a new database
48029bee » stevewilhelm
2011-07-27 fixed README example
17 db = LevelDB::DB.new "/tmp/asdf"
63e6edbb »
2011-06-16 initial version
18
5975fd7a »
2012-03-12 update README and add LICENSE
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
0ed2f714 »
2011-06-16 minor readme update
69
5975fd7a »
2012-03-12 update README and add LICENSE
70 Please report bugs to https://github.com/wmorgan/leveldb-ruby/issues.
0ed2f714 »
2011-06-16 minor readme update
71
72
Something went wrong with that request. Please try again.