Re: CDBI::DATA::Schema idea

[prev] [thread] [next] [Date index for 2004/05/22]

From: Tony Bowden
Subject: Re: CDBI::DATA::Schema idea
Date: 15:02 on 22 May 2004
On Sat, May 22, 2004 at 03:17:02PM +0100, Simon Cozens wrote:
> Since not everyone uses the same RDBMS, and not all RDBMSes use the same SQL,
> CDBI::DATA::Schema helpfully has an undocumented "translate" option which
> rewrites the schema for a different database.

Using the equally undocumented cache option is very useful here too, as
SQL::Translator is rather slow...

But it's a very nice feature. I use it for running test-suites against a
disposable SQLite database, even though the live code runs against
MySQL.

> 
>         $self->set_db(Main => @params);
>         my ($dbd) = $params[0] =~ /dbi:(\w+):/;

After a set_db call (although you should really be using connection()
now, btw), that will already be set in $class->__driver. Yes, it's
'private', but it should be fairly stable.

Tony

CDBI::DATA::Schema idea
Simon Cozens 14:17 on 22 May 2004

Re: CDBI::DATA::Schema idea
Tony Bowden 15:02 on 22 May 2004

Re: CDBI::DATA::Schema idea
Tim Bunce 11:16 on 24 May 2004

Generated at 11:35 on 01 Dec 2004 by mariachi v0.52