[Dbix-class] RE: Re: Question about dynamic class generation (DBIx::Class::Schema::Loader) (Brandon Black)

Brandon Black blblack at gmail.com
Tue Feb 7 18:25:04 CET 2006


On 2/7/06, Nigel Metheringham <nigel.metheringham at dev.intechnology.co.uk> wrote:
> On Tue, 2006-02-07 at 17:26 +0100, Leandro Hermida wrote:
> > Oh, I thought DBIx::Class::Loader was mean't to tackle this need.  For large
> > database models one really needs the ORM classes generated automatically.
> > Do you think there is interest in developing functionality for automating
> > the generation of the DBIx::Class::Schema class files?  I think this is a
> > good concept especially for really large database models where you want the
> > ORM system to just give you the abstraction and not have to create/maintain
> > potentially hundreds of files.
>

The downside there is that it is very difficult to discern all of the
metadata (esp wrt relationships) that DBIx::Class really needs to know
from a SQL connection.  DBIx::Class ends up knowing (or wanting to
know) more about your Schema than SQL does (or at least, that SQL
easily exports to us).

> You can also use SQLT to convert a DB schema (including dredging the
> structure out of a live database) into a DBIx::Class::Schema definition
> - although it spits everything out as one file at present, so I would
> want to do a batch of splitting into class files.  [You could of course
> put the automatically generated chunk in your schema definition and then
> your frosting, topping, additional methods etc into other files...]
>
> At present there are naming/mapping convention differences between this
> process and ..::Schema::Loader
>

And the SQLT way didn't pick up relationships last time I tried it
either, but I haven't looked recently.



More information about the Dbix-class mailing list