ODBC OG/ActiveRecords

L

Luke Galea

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!
 
D

David Heinemeier Hansson

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.
 
P

Paul Duncan

--uWPcrH1o85ekjD8l
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Luke Galea ([email protected]) said:
Hi Ruby Talk,
=20
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..
=20
BUT: I would like to use a nice object-relational library like
ActiveRecord or=20

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!

--=20
Paul Duncan <[email protected]> pabs in #ruby-lang (OPN IRC)
http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562

--uWPcrH1o85ekjD8l
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCMbytzdlT34LClWIRAg+zAKCxVkcQj3MuI9eqKSqy4TuAwjf50gCeOBJD
Uuk6YA9cH/aPoslTBJ14OJ0=
=t5aK
-----END PGP SIGNATURE-----

--uWPcrH1o85ekjD8l--
 
K

Kirk Haines

Luke said:
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_is_it.html

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

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


Kirk Haines
 
G

George Moschovitis

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,459
Latest member
Vida00R129

Latest Threads

Top