Skip to content
Ruby bindings for Sleepycat Berkeley DB and DB XML by Guy Decoux
C Ruby C++ R Perl6 Eiffel Other
Latest commit 2a5a2fe @knu Merge pull request #3 from swills/master
Don't check the patchlevel for version compat, things shouldn't break ac...



A Ruby interface to Berkeley DB distributed by Oracle


  • db >= 2 (some functionnality like join are not available with db < 2.6)

For Berkeley DB 1.85 and 1.86 see bdb1


See the examples directory for code examples.


You can install this module simply by:

gem install bdb

Use the --with-db-dir=$prefix option to specify with which libdb this extension should be linked.


With bdb >= 0.5.5 `nil' is stored as an empty string (when marshal is not used).

Open the database with

"store_nil_as_null" => true

if you want the old behavior (nil' stored as\000').


  • examples/basic.rb

    simple access method

  • examples/recno.rb

    access to flat file

  • examples/cursor.rb

    direct cursor access

  • examples/txn.rb


  • examples/join.rb

    join (need db >= 2.6)

  • examples/log.rb

    log file


Copyright (c) 2000-2008 Guy Decoux Copyright (c) 2008-2011 Akinori MUSHA

You can redistribute it and/or modify it under the same term as Ruby.

Something went wrong with that request. Please try again.