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

Matt S Trout dbix-class at trout.me.uk
Thu Apr 30 22:46:58 GMT 2009


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