[Dbix-class] Advise

Bogdan Lucaciu bogdan at wiz.ro
Mon Jul 24 19:33:28 CEST 2006


On Mon, 2006-07-24 at 15:52 +0000, Duncan Ferguson wrote:
> Wotcha,
> 
> I have set up a perl module using Class::DBI to access a mysql
> database of my own design at my work.  Then 2 things happened.  The
> first was I discovered DBIx::Class, and the second is that the data
> source I was using (an excel spreadsheet which I import into my DB) is
> being imported into a data warehouse by someone else in the business
> and I have no say in how it has been designed (however, I have been
> told I can plug into the new database to save data duplication - the
> new database will be the gold source and the spreadsheet dropped).
> 
> Since I have to rework everything I am starting from scratch with
> DBIx::Class.
> 
> My problem is that it seems little or no thought is being put into the
> design and the spreadsheet is being dumped into one table (rather than
> split it all out into seperate tables like I had - requires too much
> thought and work for them obviously...).
> 
> What is the best way to set up my schema to split out the classes
> virtually?  I guess I can write a number of modules with different
> names (as I had them before in my own design) all referencing
> different columns within the same table, but what does this mean for
> the unique id's for ResultSource's (that no longer exist in the new
> data) that DBIC seems to require?  Is this possible to cope with this
> DBIC?
> 

Why don't you use views?

http://www.postgresql.org/docs/7.3/interactive/rules-views.html
http://dev.mysql.com/doc/refman/5.0/en/create-view.html

-- 
Bogdan Lucaciu <bogdan at wiz.ro>




More information about the Dbix-class mailing list