-
-
23 May 2007 17:08:55 UTC
- Distribution: Catalyst-Model-DBIC-Schema
- Module version: 0.20
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (6)
- Testers (116 / 3 / 1)
- Kwalitee
Bus factor: 11- License: perl_5
- Activity
24 month- Tools
- Download (24.53KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Catalyst::Runtime
- Class::Accessor::Fast
- Class::Data::Accessor
- DBIx::Class
- UNIVERSAL::require
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Catalyst::Helper::Model::DBIC::Schema - Helper for DBIC Schema Models
SYNOPSIS
script/create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass [ create=dynamic | create=static ] [ connect_info arguments ]
DESCRIPTION
Helper for the DBIC Schema Models.
Arguments:
CatalystModelName
is the short name for the Catalyst Model class being generated (i.e. callable with$c->model('CatalystModelName')
).MyApp::SchemaClass
is the fully qualified classname of your Schema, which might or might not yet exist. Note that you should have a good reason to create this under a new global namespace, otherwise use an existing top level namespace for your schema class.create=dynamic
instructs this Helper to generate the named Schema class for you, basing it on DBIx::Class::Schema::Loader (which means the table information will always be dynamically loaded at runtime from the database).create=static
instructs this Helper to generate the named Schema class for you, using DBIx::Class::Schema::Loader in "one shot" mode to create a standard, manually-defined DBIx::Class::Schema setup, based on what the Loader sees in your database at this moment. A Schema/Model pair generated this way will not require DBIx::Class::Schema::Loader at runtime, and will not automatically adapt itself to changes in your database structure. You can edit the generated classes by hand to refine them.connect_info
arguments are the same as what DBIx::Class::Schema::connect expects, and are storage_type-specific. For DBI-based storage, these arguments are the dsn, username, password, and connect options, respectively. These are optional for existing Schemas, but required if you use either of thecreate=
options.Use of either of the
create=
options requires DBIx::Class::Schema::Loader.TYPICAL EXAMPLES
# Use DBIx::Class::Schema::Loader to create a static DBIx::Class::Schema, # and a Model which references it: script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass create=static dbi:mysql:foodb myuname mypass # Create a dynamic DBIx::Class::Schema::Loader-based Schema, # and a Model which references it: script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass create=dynamic dbi:mysql:foodb myuname mypass # Reference an existing Schema of any kind, and provide some connection information for ->config: script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass dbi:mysql:foodb myuname mypass # Same, but don't supply connect information yet (you'll need to do this # in your app config, or [not recommended] in the schema itself). script/myapp_create.pl model ModelName DBIC::Schema My::SchemaClass
METHODS
mk_compclass
SEE ALSO
General Catalyst Stuff:
Catalyst::Manual, Catalyst::Test, Catalyst::Request, Catalyst::Response, Catalyst::Helper, Catalyst,
Stuff related to DBIC and this Model style:
DBIx::Class, DBIx::Class::Schema, DBIx::Class::Schema::Loader, Catalyst::Model::DBIC::Schema
AUTHOR
Brandon L Black,
blblack@gmail.com
LICENSE
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Catalyst::Model::DBIC::Schema, copy and paste the appropriate command in to your terminal.
cpanm Catalyst::Model::DBIC::Schema
perl -MCPAN -e shell install Catalyst::Model::DBIC::Schema
For more information on module installation, please visit the detailed CPAN module installation guide.