# DBrb 0.1.0

**URL:** <https://www.ruby-forum.com/t/dbrb-0-1-0/95306>\
**Category:** Ruby\
**Created:** [May 27, 2006, 1:45pm UTC](https://www.ruby-forum.com/t/dbrb-0-1-0/95306 "2006-05-27T13:45:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbobker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/73ab20/32.png) [@tbobker](https://www.ruby-forum.com/u/tbobker)\
**Post date:** [May 27, 2006, 1:45pm UTC](https://www.ruby-forum.com/t/dbrb-0-1-0/95306/1 "2006-05-27T13:45:40Z")

</div>

I’m happy to announce the initial release of DBrb. DBrb is a minimal  
database access API that’s implemented as a wrapper around the DBI API.

I’ve written it because I’m to stupid to remember all the different ways  
to access DBI, and found myself interspersing my scripts with naked SQL  
statements during development, leaving them for later to figure out how  
to  
actually execute them after finishing the “Ruby” parts of my scripts.  
DBrb reflects this style of programming.

## Some Examples:

- Initializing the library:

- Basic SELECT stuff:

(a call to the method `sql` executes the sql statement and returns the  
first row  
returned by that call, or `nil`.)

- SELECT with a block:

(calling `sql` with a block iterates over all results returned by the  
sql statement. The yielded row is a DBI::Row object extended to  
respond to the names of the columns in the database. In case of  
naming conflicts, you can still use `row[COLUMN_NAME]`)

- INSERT’s, UPDATE’s, etc. work the same;

Homepage: [DBrb : Ruby Database Access](http://www.kuriositaet.de/ruby/dbrb/)  
Rubyforge: [http://rubyforge.org/projects/dbrb/](http://rubyforge.org/projects/dbrb/)

This is an initial release, the main TODOs are implementing a  
database indepedant way of handling transactions and creating  
tests for different database backends.

The code necessary to implement this library is not very large or  
complex. Yet I’ve found it to boost my productivity immensely,  
expecially writing ad hoc scripts connecting to a database. I  
hope it may turn out to be useful for others.

-Tim B.
