[Catalyst] model connect info to come from YAML configuration file

Hermida, Leandro Leandro.Hermida at fmi.ch
Tue Dec 5 13:51:10 GMT 2006


Hi, thank you.  Sorry I am a new user who has just finished the tutorial
and seeing "where I can go next" and I now I am starting to put things
together that the YAML file maps to the namespace and fills the
__PACKAGE__->config() in that namespace.  Cool!!

Is there any way to make the YAML file a bit more "user friendly"?
Meaning that things are more explicit to non-programmers if I were to
deploy that catalyst project somewhere else.  Something like:

MyAppDB:
    driver: mysql
    host: dbserver.domain.com
    port: 3306
    username: dbuser
    password: dbpass

And then taking these parameters and generating the right config in the
model?

Leandro


-----Original Message-----
From: Brian Cassidy [mailto:brian.cassidy at nald.ca] 
Sent: Tuesday, December 05, 2006 14:29
To: The elegant MVC web framework
Subject: Re: [Catalyst] model connect info to come from YAML
configuration file

Hermida, Leandro wrote:
> Inside MyApp::Model::MyAppDB:
>
> use strict;
> use base 'Catalyst::Model::DBIC::Schema';
>
> __PACKAGE__->config(
>     schema_class => 'MyAppDB',
>     connect_info => [
>         'dbi:SQLite:myapp.db',
>         '',
>         '',
>         { AutoCommit => 1 },
>         
>     ],
> );
>   

Model::MyAppDB:
  schema_class: MyAppDB
  connect_info:
    - dbi:SQLite:myapp.db
    - ''
    - ''
    - AutoCommit: 1

-Brian


_______________________________________________
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