[Catalyst] recommendation
Kieren Diment
diment at gmail.com
Mon Nov 10 20:49:39 GMT 2008
On Mon, Nov 10, 2008 at 07:31:09PM +0200, Octavian Rasnita wrote:
> Hi,
>
> Especially for a beginner, but not only, the most simple way of creating the
> DBIC classes for a Catalyst app is to use the DBIC::Schema helper.
I tend to prefer using DBIC::Schema::Loader directly. Here's an example:
#!/usr/bin/perl
use warnings;
use strict;
use DBIx::Class::Schema::Loader qw/ make_schema_at /;
make_schema_at("Zotero::Meta",
{
components => ['InflateColumn::DateTime'],
debug => 1,
relationships => 1,
dump_directory => './lib' ,
},
["dbi:SQLite:dbname=db/meta.db", "",""]);
But the BEGIN block advice is also sound. As far as using
EncodedColumn goes, I'd recommend having a look at
Catalyst::Helper::AuthDBIC for an example of how to achieve this with
Schema::Loader generated classes (although it doesn't use the BEGIN
trick because I didn't know about it).
>
> I've seen that there are many components of DBIx::Class that can't be used
> if using this helper, because they should be loaded before Core or they
> require changing the part of the class that can't be modified.
>
> Which is the recommended way for creating a complex app that needs using
> those components?
> After we change something in the structure of some database tables, the
> single way of updating the DBIC classes is to make the update manually?
> Or it is recommended to avoid using components which are not compatible with
> the Catalyst helper?
>
> Thanks.
>
> Octavian
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
More information about the Catalyst
mailing list