[Dbix-class] Problem with DBIx::Class::Schema::Loader
Brandon Black
blblack at gmail.com
Mon Aug 28 22:54:20 CEST 2006
On 8/28/06, Nathanial Hendler <nathan at petfinder.com> wrote:
>
>
> Is there an example anywhere of doing it the "abnormal" way? I'm not
> sure of all the things that need to be done to keep it from having to
> scan the database at load time.
In the Schema::Loader docs here:
http://search.cpan.org/~blblack/DBIx-Class-Schema-Loader-0.03007/lib/DBIx/Class/Schema/Loader.pm#make_schema_at
You'll find the rather convoluted commandline example that can do it all in
one shot:
perl -MDBIx::Class::Schema::Loader=make_schema_at,dump_to_dir:./lib -e
'make_schema_at("New::Schema::Name", { relationships => 1 }, [
"dbi:Pg:dbname=foo","postgres" ])'
Notice the "dump_to_dir:./lib" is telling it to dump into "./lib" directory,
and "New/Schema/Name.pm" will be your schema file (+ the files for each
table at New/Schema/Name/Foo.pm)
Its ugly to use from the commandline at the moment, but there should be
something prettier in the not-too-distant future (or if you're using
Catalyst, the Catalyst::Model::DBIC::Schema helper does this for you in
create=static mode)
-- Brandon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/dbix-class/attachments/20060828/c6eeeb47/attachment.htm
More information about the Dbix-class
mailing list