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'
db = LevelDB::DB.new "/tmp/asdf"
db.put "it", "works" # => "works" db.get "it" # => "works"
db["hello"] = "there" # => "there" db["hello"] # => "there"
db["nonexistent"] # => nil
db.includes? "hello" # => true db.contains? "hello" # => true
db.keys # => "it", "hello" db.values # => "there", "works"
db.each { |k, v| ... } db.map { |k, v| ... } db.each # => LevelDB::Iterator
db.each(:from => "a", :to => "b") # => LevelDB::Iterator db.each(:from => "a", :to => "b"). map { |k, v| ... }
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:
BUGS
Please report bugs to https://github.com/wmorgan/leveldb-ruby/issues.