You have to redefine all of your database tables in the Ruby code.
Erm, what? Presuming your tables conform to the Rails conventions (granted that is a substantial caveat when dealing with existing schemas and is an acknowledged weakness of Rails) you need one two line file for each stand alone table. Any relationships between tables are then specified within this class declaration.
class User < ActiveRecord::Base
With Class::DBI you'd have to have MyDB::User->has_many( projects => "MyDB::Project" ) declarations somewhere to do the same thing, so I don't really see how this is really a substantial deficiency.
Update: Just to clarify, the above declaration would suffice to get a User class which has accessors for all columns of the users table in the default database; it would also setup relationship so that a_user.projects would return an array of Project instances associated with the User instance in question (presuming of course there were an appropriate Project class with a belongs_to :user declaration). If the DB doesn't adhere to Rails' expectations as far as table and primary key names it's pretty simple to correct it (set_table_name "web_user_names"); similar options are available for foreign key names (Class::DBI has similar expectations and mechanisms for allowing variation from them). Additionally, there are code generators which will write the stubs for you so you just run script/generate model User once when creating your app and the grunt work is done; you just go in and add the relationship information.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||