[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ODBC OG/ActiveRecords

Luke Galea

3/11/2005 3:19:00 PM

Hi Ruby Talk,

I'd like to write an interface between an MS-Access DB and a Sybase Anywhere
DBs in Ruby.. Neither of these have native ruby drivers so I am resigned to
using Ruby-ODBC..

BUT: I would like to use a nice object-relational library like ActiveRecord or
OG.. Has anyone ever had any success using either over ODBC? I would expect
that if a generic "simple sql syntax" adapter were available it would likely
work on both DBs..

Thanks in advance!


4 Answers

David Heinemeier Hansson

3/11/2005 3:41:00 PM

0

> Has anyone ever had any success using either over ODBC? I would expect
> that if a generic "simple sql syntax" adapter were available it would
> likely
> work on both DBs..

Generic ODBC adapters are problematic because the databases underneath
might use different strategies for stuff like auto-incremented columns.
A Access or Sybase adapter that goes through ODBC is certainly
possible. I know that shashank and a few others were looking into that
for Active Record at some point.
--
David Heinemeier Hansson,
http://www.basec... -- Web-based Project Management
http://www.rubyon... -- Web-application framework for Ruby
http://www.loudthi... -- Broadcasting Brain



Paul Duncan

3/11/2005 3:44:00 PM

0

* Luke Galea (lgalea@gmmsolutions.com) wrote:
> Hi Ruby Talk,
>
> I'd like to write an interface between an MS-Access DB and a Sybase
> Anywhere DBs in Ruby.. Neither of these have native ruby drivers so I
> am resigned to using Ruby-ODBC..
>
> BUT: I would like to use a nice object-relational library like
> ActiveRecord or
>
> OG.. Has anyone ever had any success using either over ODBC? I would
> expect that if a generic "simple sql syntax" adapter were available it
> would likely work on both DBs..

I've written stuff at work that uses Ruby/ODBC to query an Access file.

> Thanks in advance!

--
Paul Duncan <pabs@pablotron.org> pabs in #ruby-lang (OPN IRC)
http://www.pabl... OpenPGP Key ID: 0x82C29562

Kirk Haines

3/11/2005 3:54:00 PM

0

Luke Galea wrote:

> BUT: I would like to use a nice object-relational library like
> ActiveRecord or OG.. Has anyone ever had any success using either over
> ODBC? I would expect that if a generic "simple sql syntax" adapter were
> available it would likely work on both DBs..

There is a DBI driver for ODBC, which means you should be able to use the
Kansas ORM. Kansas, as an ORM, has been feature-incomplete, but stable for
many months, and I use it on probably 20 different production applications.
It used DBI for simplicity and coverage, making it lightweight.

I say feature-incomplete because it has rough edges with regard to usage
exceptions and handling of object is_a relationships and things of that
nature. It also does not have the table creation abilities that Og does,
though I have been considering going down that road.

Tobi Fuchs has volunteered some time to help clean it up and advance it to
the next level, though, so with a little good fortune, a new version should
be forthcoming in the not too distant future.

Take a look: http://enigo.com/projects/kansas/tutorial/what_...

It's available for download from Rubyforge:
http://rubyforge.org/proje...

Give me a shout if you have any questions. I have never tried it with the
ODBC driver.


Kirk Haines

George Moschovitis

3/12/2005 7:17:00 AM

0

Hello Luke,

I 'll probably create an Og/ODBC driver real soon as I 'll need it for
a project of mine. However I am not sure, how successfully this will be
integrated with Og. It will probably be just 'good enough' for my
purpose.

Perhaps you could try and write this ODBC adapter yourself and
contribute the driver (as Matt Bowen did for the experimental Oracle
driver).

regards,
George.