[Nitro] MS Sql Server adapter

Anastasios Koutoumanos ak at navel.gr
Fri Apr 1 08:29:54 EST 2005

Hello all,

I started creating the SQL Server adapter for OG. Apparently it's almost 
done - at least it passes successfuly all the test cases. I have sent it 
to George who will (hopefully ;-) include it in the next version of og.

Let me note some issues I run into while making the adapter:

- I had to name it SqlserverAdapter, not SqlServerAdapter, due to
og\adapter.rb:43: eval %{ return #{name.capitalize}Adapter.instance }

- It was hard to track down some error messages from the ms sql driver.
It would be much better if we use eval <<-EOE, __FILE__, __LINE__ ... 
instead of eval %{ }

- Another issue that made debugging difficult is the use of *ensure* at 
the end of some functions, without a previous *rescue*. Apparently, 
should an exception was risen in the function body, no error message was 

- @typecast is probably not needed in the adapter class

- It would be nice if we used a globally unique identifier for all 
objects in the database, so that we could do an og.get(123). Then again 
this could be difficult to implement...

- we should re-write the adapters, combining multiple sql statements in 
one using the *;* separator when this is possible.

- we should definately use transactions in more places

- the *store* attribute could be renamed to db_handle

BTW, it was really nice having the chance to work again on the og/nitro 
code and check out how much it has improved since the last time (almost 
6 months ago). I'm pretty sure that this is due to the ruby community 
and that this is just the beginning!


Navel Ltd
http://www.navel.gr - info at navel.gr - +30 210 6898050

Have fun: www.joy.gr/  and create: www.navel.gr/nitro

More information about the Nitro-general mailing list