Update the README for the ruby-bdb GitHub links and tidy the formatting up a bit

This commit is contained in:
Ash Moran 2011-08-25 05:52:26 +08:00 committed by Denis Knauf
parent ad85908d16
commit 3a2d5bb3d2

View file

@ -1,7 +1,16 @@
Description Description
=== ===
Ruby bindings for Berkeley DB versions 4.2-4.8. Ruby bindings for Berkeley DB versions 4.2-5.1.
One of the [ruby-bdb][ruby-bdb] projects. See also:
* [sbdb][sbdb] - A simpler, more Ruby-like API
* [tuple][tuple] - A binary array serialisation library used by bdb internally
[ruby-bdb]: http://github.com/ruby-bdb
[sbdb]: http://github.com/ruby-bdb/sbdb
[tuple]: http://github.com/ruby-bdb/tuple
Installation Installation
============ ============
@ -11,22 +20,23 @@ From Git
You can check out the latest source from git: You can check out the latest source from git:
git clone git://github.com/DenisKnauf/bdb.git git clone git://github.com/ruby-bdb/bdb.git
As a Gem As a Gem
======== --------
At the moment this library is not available on Rubyforge. To install it as a At the moment this library is not available on RubyForge. To install it as a
gem, do the following: gem, do the following:
sudo gem install dk-bdb [sudo] gem install bdb
For Berkeley DB v4.7 installed from MacPorts do the following: For Berkeley DB v4.7 installed from MacPorts do the following:
sudo env ARCHFLAGS="-arch i386" gem install dk-bdb [sudo] env ARCHFLAGS="-arch i386" gem install bdb
This assumes you're on OS X and BerkeleyDB wasn't compiled as a universal binary. This assumes you're on OS X and BerkeleyDB wasn't compiled as a universal binary.
Sample Usage Sample Usage
============ ============
@ -51,21 +61,19 @@ Sample Usage
db.close(0) db.close(0)
env.close env.close
API API
=== ===
This interface is most closely based on the DB4 C api and tries to maintain close This interface is most closely based on the DB4 C api and tries to maintain close
interface proximity. interface proximity. [That API is published by Oracle][oracle-api].
[That API is published by Oracle](http://www.oracle.com/technology/documentation/berkeley-db/db/api_reference/C/frame_main.html).
[oracle-api]: http://www.oracle.com/technology/documentation/berkeley-db/db/api_reference/C/frame_main.html
All function arguments systematically omit the leading DB handles and TXN handles. All function arguments systematically omit the leading DB handles and TXN handles.
A few calls omit the flags parameter when the documentation indicates that no A few calls omit the flags parameter when the documentation indicates that no
flag values are used - cursor.close is one. flag values are used - cursor.close is one.
Alternative API
---------------
You can use [SBDB](http://github.com/DenisKnauf/sbdb), too. It is easier to use, but base on this library.
Notes Notes
===== =====
@ -80,9 +88,11 @@ flawlessly.
The authors have put all possible caution into ensuring that DB and Ruby cooperate. The authors have put all possible caution into ensuring that DB and Ruby cooperate.
The memory access was one aspect carefully considered. Since Ruby copies The memory access was one aspect carefully considered. Since Ruby copies
when doing String#new, all key/data retrieval from DB is done with a 0 flag, when doing String#new, all key/data retrieval from DB is done with a 0 flag,
meaning that DB will be responsible. See [*this* news group posting](http://groups.google.com/group/comp.databases.berkeley-db/browse_frm/thread/4f70a9999b64ce6a/c06b94692e3cbc41?tvc=1&q=dbt+malloc#c06b94692e3cbc41) meaning that DB will be responsible. See [*this* news group posting][newsgroup-post]
about the effect of that. about the effect of that.
[newsgroup-post]: http://groups.google.com/group/comp.databases.berkeley-db/browse_frm/thread/4f70a9999b64ce6a/c06b94692e3cbc41?tvc=1&q=dbt+malloc#c06b94692e3cbc41
The only other design consideration of consequence was associate. The prior The only other design consideration of consequence was associate. The prior
version used a Ruby thread local variable and kept track of the current version used a Ruby thread local variable and kept track of the current
database in use. The authors decided to take a simpler approach since Ruby is green database in use. The authors decided to take a simpler approach since Ruby is green