[Catalyst] schema
Octavian Rasnita
orasnita at gmail.com
Mon Dec 25 02:33:13 GMT 2006
Yes, sorry, I haven't explained very well, and I think I have found a
solution.
I have a few databases which are similar. Most of the tables are the same,
and in some of them I have more other tables or some tables redefined.
I want to test the application using a certain database, and if all works
right, I want to use it with another one, and I don't want to need creating
another Catalyst application just because I have changed the database.
If I write the name of the database in more modules it will be harder to
change its name, but now I I think that I could use something like:
$c->model($c->config->{db});
and just change the name of the db in the application config.
Octavian
----- Original Message -----
From: "Robert 'phaylon' Sedlacek" <rs at 474.at>
To: "The elegant MVC web framework" <catalyst at lists.rawmode.org>
Sent: Sunday, December 24, 2006 8:14 AM
Subject: Re: [Catalyst] schema
Octavian Rasnita said:
> I need to access the same database in more controller modules, using the
> following line in every subroutine and every module:
>
> my $schema = $c->model('DB');
>
> Is it possible to define it only in one place and make it available in the
> entire application?
Sorry, I don't get it. $c->model() *is* available in the entire application.
--
# Robert 'phaylon' Sedlacek
# Perl 5/Catalyst Developer in Hamburg, Germany
{ EMail => ' rs at 474.at ', Web => ' http://474.at ' }
_______________________________________________
List: Catalyst at lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/
More information about the Catalyst
mailing list