Forum: Ruby Read Database Metadata

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5e10b0ee1ff34d64c82be83666de297c?d=identicon&s=25 Xd Ork (xdork)
on 2008-11-27 06:49
Hi All,

  I'm reviewing Ruby if its appropriate for my project. I'm planning to
port my existing application made from Java to Ruby but before I do that
I have to check if Ruby have capablities of doing the following:

  1. Connect to different Database.
  2. Read Database Metadata.
  3. JDBC like way of communicating with databases.


  I would really appreciate if you can name some APIs and documents that
may enlighten me with my queries.

Thanks in advance,
Jag
753dcb78b3a3651127665da4bed3c782?d=identicon&s=25 Brian Candler (candlerb)
on 2008-11-27 13:38
Xd Ork wrote:
>   I'm reviewing Ruby if its appropriate for my project. I'm planning to
> port my existing application made from Java to Ruby but before I do that
> I have to check if Ruby have capablities of doing the following:
>
>   1. Connect to different Database.
>   2. Read Database Metadata.
>   3. JDBC like way of communicating with databases.

You can certainly connect to different databases and read metadata. I
have no idea what a "JDBC like way" of communicating with databases
means.

>   I would really appreciate if you can name some APIs and documents that
> may enlighten me with my queries.

http://ar.rubyonrails.com/      [used by Rails]
http://sequel.rubyforge.org/
http://datamapper.org
http://www.nitroproject.org/    [look for og]

Plus you have the lower-level ruby-dbi, and then the low-level APIs for
the native databases (e.g. ruby-oci8 for Oracle)
D1f1c20467562fc1d8c8aa0d328def62?d=identicon&s=25 Florian Gilcher (skade)
on 2008-11-27 13:55
(Received via mailing list)
On Nov 27, 2008, at 6:44 AM, Xd Ork wrote:

>
If you want do have a behaviour that matches JDBC, use JRuby and
JDBC ;).

But to make things clear: Ruby as well as Java has no idea what a
database is.
So it is not a "Ruby capability". But there are enough well-tested
libraries for
doing this in a lot of fashions that you can imagine. Databases are no
problem.

Regards,
Florian Gilcher
5e10b0ee1ff34d64c82be83666de297c?d=identicon&s=25 Xd Ork (xdork)
on 2008-11-28 01:44
Florian Gilcher wrote:
> On Nov 27, 2008, at 6:44 AM, Xd Ork wrote:
>
>>
> If you want do have a behaviour that matches JDBC, use JRuby and
> JDBC ;).
>
> But to make things clear: Ruby as well as Java has no idea what a
> database is.
> So it is not a "Ruby capability". But there are enough well-tested
> libraries for
> doing this in a lot of fashions that you can imagine. Databases are no
> problem.
>
> Regards,
> Florian Gilcher


Thanks Florian for the reply.
I already tried JRuby and JDBC but I was thinking that since JDBC is
really for java, my code will then be only run in JRuby, making my
application requires their runtime which for me is not ideal and there's
is no point anymore of migrating my old java application to ruby. I'm
looking for a library which works like JDBC. I googled around and found
Ramen but it only works now for few database. Can you name some library?
5e10b0ee1ff34d64c82be83666de297c?d=identicon&s=25 Xd Ork (xdork)
on 2008-11-28 01:50
Brian Candler wrote:
> Xd Ork wrote:
>>   I'm reviewing Ruby if its appropriate for my project. I'm planning to
>> port my existing application made from Java to Ruby but before I do that
>> I have to check if Ruby have capablities of doing the following:
>>
>>   1. Connect to different Database.
>>   2. Read Database Metadata.
>>   3. JDBC like way of communicating with databases.
>
> You can certainly connect to different databases and read metadata. I
> have no idea what a "JDBC like way" of communicating with databases
> means.
>
>>   I would really appreciate if you can name some APIs and documents that
>> may enlighten me with my queries.
>
> http://ar.rubyonrails.com/      [used by Rails]
> http://sequel.rubyforge.org/
> http://datamapper.org
> http://www.nitroproject.org/    [look for og]
>
> Plus you have the lower-level ruby-dbi, and then the low-level APIs for
> the native databases (e.g. ruby-oci8 for Oracle)


Hi,

 In JDBC, to connect into a database you just need to have a driver for
the database you want to connect to. Once connected you can get the
metadata of the database and query its properties. Same code and logic
will work in any database. These are the kinds of freatures I'm looking
if there is an equivalent in Ruby.

Thanks
Jag
This topic is locked and can not be replied to.