Ruby bindings for LevelDB
C++ Ruby C Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ext/leveldb
leveldb update leveldb to commit d0d562b4d4fbd07db6a44f9e221f8d368fee8e4 (may… Jun 26, 2012
lib make compression options classes instead of enums Jun 26, 2012
test
.gitignore update .gitignore Jun 26, 2012
Changelog add Changelog Jun 26, 2012
LICENSE update README and add LICENSE Mar 13, 2012
README update README and add LICENSE Mar 13, 2012
RELEASE-SCRIPT update RELEASE-SCRIPT Jun 26, 2012
Rakefile
setup.rb add setup.rb Jul 12, 2011

README

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.