[Dbix-class] RFC: Load from SQL

Jeff Zucker jeff at vpservices.com
Tue Jul 10 22:07:08 GMT 2007


Brandon Black wrote:
> On 7/10/07, Jeff Zucker <jeff at vpservices.com> wrote:
>  If you want to treat those oddball DBD's as
> if they were not DBI-like, you could make a new
> DBIx::Class::Schema::Loader::Foo.   However, if your backends are in
> fact DBD's, one way to support them would be to bring them up to speed
> with regard to the optional DBI metadata methods [1].
>
Yep, the problem is that they are so oddball that they never store any 
metadata other than the column names (think of a standard CSV file - no 
primary key info, no column types ...).  So with no metadata stored, 
there's nothing for the DBI methods to query.  The cool thing about the 
Loader is that you can use e.g. MySQL DDL syntax to make relationships 
between CSV files that have no metadata ... the example at perlmonks 
works with CSV even though DBD::CSV a) doesn't understand Foreign Keys 
and b) doesn't natively support three table joins.  It works because I 
use SQLT's MySQL parser on the DDL.  Eventutally I can make the DBDs 
store their DDL so that the metadata will be saved (in a schema.cfg file 
or some such) but that's too much work for summetime :-).

-- 
Jeff



More information about the Dbix-class mailing list