Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dbicdump(1p) [debian man page]

DBICDUMP(1p)						User Contributed Perl Documentation					      DBICDUMP(1p)

NAME
dbicdump - Dump a schema using DBIx::Class::Schema::Loader SYNOPSIS
dbicdump <configuration_file> dbicdump [-I <lib-path>] [-o <loader_option>=<value> ] <schema_class> <connect_info> Examples: $ dbicdump schema.conf $ dbicdump -o dump_directory=./lib -o components='["InflateColumn::DateTime"]' MyApp::Schema dbi:SQLite:./foo.db $ dbicdump -o dump_directory=./lib -o components='["InflateColumn::DateTime"]' MyApp::Schema dbi:SQLite:./foo.db '{ quote_char => """ }' $ dbicdump -Ilib -o dump_directory=./lib -o components='["InflateColumn::DateTime"]' -o preserve_case=1 MyApp::Schema dbi:mysql:database=foo user pass '{ quote_char => "`" }' $ dbicdump -o dump_directory=./lib -o components='["InflateColumn::DateTime"]' MyApp::Schema 'dbi:mysql:database=foo;host=domain.tld;port=3306' user pass On Windows that would be: $ dbicdump -o dump_directory=.lib ^ -o components="[q{InflateColumn::DateTime}]" ^ -o preserve_case=1 ^ MyApp::Schema dbi:mysql:database=foo user pass "{ quote_char => q{`} }" Configuration files must have schema_class and connect_info sections, an example of a general config file is as follows: schema_class MyApp::Schema lib /extra/perl/libs # connection string <connect_info> dsn dbi:mysql:example user root pass secret </connect_info> # dbic loader options <loader_options> components InflateColumn::DateTime components TimeStamp </loader_options> Using a config file requires Config::Any installed. The optional "lib" key is equivalent to the "-I" option. DESCRIPTION
Dbicdump generates a DBIx::Class schema using "make_schema_at" in DBIx::Class::Schema::Loader and dumps it to disk. You can pass any DBIx::Class::Schema::Loader::Base constructor option using "-o <option>=<value>". For convenience, option names will have "-" replaced with "_" and values that look like references or quote-like operators will be "eval"-ed before being passed to the constructor. The "dump_directory" option defaults to the current directory if not specified. SEE ALSO
DBIx::Class::Schema::Loader, DBIx::Class. AUTHOR
Dagfinn Ilmari Manns?ker "<ilmari@ilmari.org>" CONTRIBUTORS
Caelum: Rafael Kitover <rkitover@cpan.org> alnewkirk: Al Newkirk <awncorp@cpan.org> LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-10-31 DBICDUMP(1p)

Check Out this Related Man Page

Catalyst::Helper::Model::DBIC::Schema(3pm)		User Contributed Perl Documentation		Catalyst::Helper::Model::DBIC::Schema(3pm)

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 ] [ traits=trait1,trait2... ] [ Schema::Loader opts ] [ dsn user pass ] [ other connect_info args ] 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. "traits" is the list of traits to apply to the model, see Catalyst::Model::DBIC::Schema for details. "Schema::Loader opts" are documented in DBIx::Class::Schema::Loader::Base and some examples are given in "TYPICAL EXAMPLES" below. "connect_info" arguments are the same as what "connect" in DBIx::Class::Schema expects, and are storage_type-specific. They are documented in "connect_info" in DBIx::Class::Storage::DBI. 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 the "create=" options. username and password can be omitted for "SQLite" dsns. 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 Same, with extra connect_info args user and pass can be omitted for sqlite, since they are always empty script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass create=static dbi:SQLite:foo.db AutoCommit=1 cursor_class=DBIx::Class::Cursor::Cached on_connect_do='["select 1", "select 2"]' quote_names=1 ON WINDOWS COMMAND LINES QUOTING RULES ARE DIFFERENT In "cmd.exe" the above example would be: script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass create=static dbi:SQLite:foo.db AutoCommit=1 cursor_class=DBIx::Class::Cursor::Cached on_connect_do="["select 1", "select 2"]" quote_names=1 Same, but with extra Schema::Loader args (separate multiple values by commas): script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass create=static db_schema=foodb components=Foo,Bar exclude='^(wibble|wobble)$' moniker_map='{ foo => "FOO" }' dbi:Pg:dbname=foodb myuname mypass Coderefs are also supported: script/myapp_create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass create=static inflect_singular='sub { $_[0] =~ /A(.+?)(_id)?z/; $1 }' moniker_map='sub { join(q{}, map ucfirst, split(/[W_]+/, lc $_[0])); }' dbi:mysql:foodb myuname mypass See DBIx::Class::Schema::Loader::Base for a list of options Create a dynamic DBIx::Class::Schema::Loader-based Schema, and a Model which references it (DEPRECATED): 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 This is called by Catalyst::Helper with the commandline args to generate the files. run Can be called on an instance to generate the files. 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
See "AUTHOR" in Catalyst::Model::DBIC::Schema and "CONTRIBUTORS" in Catalyst::Model::DBIC::Schema. COPYRIGHT
See "COPYRIGHT" in Catalyst::Model::DBIC::Schema. LICENSE
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-06-12 Catalyst::Helper::Model::DBIC::Schema(3pm)
Man Page