Similar to 
http://groups.google.com/group/sequel-talk/browse_thread/thread/8f3434c053ca8287
but I don't have a scheme for pairing a DB column name and a
Sequel::Model's or Dataset's key.

I'm using a legacy database with horrible, old table names and column
names. Table names can be fixed with set_dataset (grep for set_dataset
on http://sequel.rubyforge.org/rdoc/files/README_rdoc.html).

Column names, however, are completely arbitrary. For examples:
    I want :vendor_name to map to the VNDR_NM column,
    I want :vendor_duns_number to map to the VNDR_DUNS_NBR column,
    I want :vendor_payment_terms_code to map to the VNDR_PMT_TERM_CD
column.

In this way I could call Vendor.filter(:vendor_name => 'IBM') to
access VNDR_T where VNDR_NM = 'IBM'

So these would have to be pulled from a configuration file or some
such (This is in fact how the java web app that uses the database maps
to the crazy-name columns: with many lengthy XML files. The fun
configuration-over-convention method :) ).

I can worry about that side of this problem. I just want something
similar to Sequel::Model#set_dataset for column names.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to