[Catalyst] Catalyst::Helper::Model::DBIC::Schema patchette?

Jonathan Rockway jon at jrock.us
Thu Jan 18 16:32:48 GMT 2007


Kieren Diment wrote:
> script/myapp_create.pl model CatalystModelName DBIC::Schema
> MySchemaClass [ create=dynamic | create=static ] [ connect_info arguments ]

I would recommend an example that uses some usual naming conventions:

create.pl model SomethingDB DBIC::Schema Schema::SomethingDB
create=static dbi:SQLite:database

In fact, I would recommend that:

create.pl model SomethingDB DBIC::Schema dbi:...

Does What They Mean, i.e. create a static schmea in
MyApp::Schema::SomethingDB::*.  That would save typing for the very
common case.

Finally, the helper should add two scripts as well:
myapp_somethingdb_createschema.pl (that will copy the schema from a
named object to a DBIC schema module), and myapp_somethingdb_deploy.pl,
which will push the schema to the database named in the
myapp.[cfg|yml|whatever] file.

I'm a bit swamped at the moment, but these should be super simple to
write.  Copy mojomojo_spawn as the _deploy script, and just do a
one-liner around SQL::Translator for the _createschema.pl script.

If someone would implement that, it would make DBIC::Schema even more
pleasant than it already is. ;)

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;



More information about the Catalyst mailing list