Db4o oo database for ruby?


I saw that the guys at db4o support ruby to some degree and I wanted
to know if anyone tried the db under ruby. Is this functional?
(project db4ro)

Best regards and thx!

Dear gerpux,

I saw that the guys at db4o support ruby to some degree and I wanted
to know if anyone tried the db under ruby. Is this functional?http://developer.db4o.com/ProjectSpaces/view.aspx/Tools_And_Add-Ons/L
(project db4ro)
The issue has two sides:

  1. I know that the db4o guys have ideas for a binding of the Java-db4o
    to Ruby.
    ButI have no knowledge how far this project has gone. Perhaps it’s
    easier even now with JRuby.
    If this is interesting for you (as the Java-Version is fast as hell
    and very mature)
    you might want to ask in the public db4o Forum about this.

  2. The db4ro project on rubyforge.org is a research project. We didn’t
    have much time
    recently because we organize this object database conference
    Nevertheless db4ro is a rewritten clone of db4o with the same basic
    API and some research more
    (but missing a 10000 db4o features). Just yesterday night it started
    being able to read simple
    objects and read them all (see Listing 1). You might check out he
    public code but I can not
    recommend this, as the current codebase is horrible, small and needs
    to be refactored massively.

Furthermore we have a smart research API that is not yet linked into
the db4ro codebase
but the query codebase is already mature and sometimes reminds you of
AOQL being described
in the paper cited here http://odbms.org/about_news_20071015.html
See Listing 2. The query work has been done by Sten Friedrich and is
still ongoing.

If you have any more questions, don’t hesitate to ask here or me

Stefan Edlich
(Author of “The Definitive Guide to db4o” Apress Ic.)

Listing 1
class Simpleexample
def rundb4ro
db = Db4ro.get_object_container (“C:/tmp/db4ro/db” +
Db4ro.log.info(“Starting db4o example…”)
t = db.getTransaction()
p1 = Person.new
p1.name = “John”
p1.age = 42
p1.name = “Susy”
p1.age = 42
p1.name = “Ben”
p1.age = 42
plist = db.get(Person.class)
plist.each do |a_person|
Db4ro.log.info(“Objekt ausgelesen = #{a_person.to_s}”)
Db4ro.log.info(“Finishing db4o example!”)

Listing 2: (Query Beispiele)

customers_list = customers.qwhere{|c| c.address.city==“London”}

objects_list = customers.qselect{|c| [{:firstname => c.firstname},
c.lastname, {:street => c.address.street.upcase},

customers_group = customers.qgroupby{|c| c}

min_creditlimit = customers.qwhere{|c| c.address.city==“London”}.qmin{|
c| c.creditlimit}

sum_creditlimit = customers.qwhere{|c| c.address.city==“London”}.qsum{|
c| c.creditlimit}

anonym_objects_list = customers.qjoin(orders){|c, o| [c, o.customer,
{:name => c.firstname + " " + c.lastname, :orderdate =>
o.orderdate, :orderprice => o.price, :avgpriceforcustomer =>
c.orders.qavg{|o| o.price}}]}

unique_prices = product_unitprices.qunion(order_prices).qorderby{|p|

and many more …

On Oct 30, 8:23 am, “[email protected][email protected] wrote:

to be refactored massively.
I don’t recommend to create a separate rewrite, though. We currently
produce Java and .NET version with a converter called “Sharpen”. I
don’t know whetehr it would be possible to write a J2R converter, but
I would certainly recommend to investigate this path thoroughly if
there’s interest.

Please contact removed_em[email protected] if you’re interested to contribute to
this project.

db4objects, Inc.