[Dbix-class] Fw: Dynamism in a static model

Ido Perelmutter ido50 at yahoo.com
Fri May 1 11:09:25 GMT 2009


Thanks Matt, that was actually pretty easy. I didn't quite understand what you meant by generating the class "in memory", so I simply created the class file on the system before printing the appropriate code in it.

Works like a charm, thanks.

Ido.


--- On Fri, 5/1/09, Matt S Trout <dbix-class at trout.me.uk> wrote:

> From: Matt S Trout <dbix-class at trout.me.uk>
> Subject: Re: [Dbix-class] Fw: Dynamism in a static model
> To: ido50 at yahoo.com, "DBIx::Class user and developer list" <dbix-class at lists.scsys.co.uk>
> Date: Friday, May 1, 2009, 1:46 AM
> On Thu, Apr 30, 2009 at 08:04:36AM -0700, Ido Perelmutter
> wrote:
> > > I am working on a Catalyst application that
> allows the
> > > end-user to add their own tables to the database
> (for the
> > > matter it is a CMS). The application creates the
> tables by
> > > using
> $c->model('DB')->storage->sth($sql)
> > > which is easy.
> 
> Don't do that. generate the DBIx::Class class in
> memory, register it with
> your schema, re-connect the schema and then use
> $schema->deploy.
> 
> It'll work fine. The problem is you're starting
> from the wrong end.
> 
> 
> -- 
>         Matt S Trout         Catalyst and DBIx::Class
> consultancy with a clue
>      Technical Director      and a commit bit:
> http://shadowcat.co.uk/catalyst/
>  Shadowcat Systems Limited
>   mst (@) shadowcat.co.uk       
> http://shadowcat.co.uk/blog/matt-s-trout/


      



More information about the DBIx-Class mailing list