1SQL::Translator::ParserU:s:eDrBICxo:n:tCrliabsust(e3d)PSeQrLl::DTorcaunmselnattaotri:o:nParser::DBIx::Class(3)
2
3
4

NAME

6       SQL::Translator::Parser::DBIx::Class - Create a SQL::Translator schema
7       from a DBIx::Class::Schema instance
8

SYNOPSIS

10        ## Via DBIx::Class
11        use MyApp::Schema;
12        my $schema = MyApp::Schema->connect("dbi:SQLite:something.db");
13        $schema->create_ddl_dir();
14        ## or
15        $schema->deploy();
16
17        ## Standalone
18        use MyApp::Schema;
19        use SQL::Translator;
20
21        my $schema = MyApp::Schema->connect;
22        my $trans  = SQL::Translator->new (
23             parser      => 'SQL::Translator::Parser::DBIx::Class',
24             parser_args => {
25                 package => $schema,
26                 add_fk_index => 0,
27                 sources => [qw/
28                   Artist
29                   CD
30                 /],
31             },
32             producer    => 'SQLite',
33            ) or die SQL::Translator->error;
34        my $out = $trans->translate() or die $trans->error;
35

DESCRIPTION

37       This class requires SQL::Translator installed to work.
38
39       "SQL::Translator::Parser::DBIx::Class" reads a DBIx::Class schema,
40       interrogates the columns, and stuffs it all in an $sqlt_schema object.
41
42       Its primary use is in deploying database layouts described as a set of
43       DBIx::Class classes, to a database. To do this, see "deploy" in
44       DBIx::Class::Schema.
45
46       This can also be achieved by having DBIx::Class export the schema as a
47       set of SQL files ready for import into your database, or passed to
48       other machines that need to have your application installed but don't
49       have SQL::Translator installed. To do this see "create_ddl_dir" in
50       DBIx::Class::Schema.
51

PARSER OPTIONS

53   add_fk_index
54       Create an index for each foreign key.  Enabled by default, as having
55       indexed foreign key columns is normally the sensible thing to do.
56
57   sources
58       Arguments: \@class_names
59
60       Limit the amount of parsed sources by supplying an explicit list of
61       source names.
62

SEE ALSO

64       SQL::Translator, DBIx::Class::Schema
65

AUTHORS

67       See "CONTRIBUTORS" in DBIx::Class.
68

LICENSE

70       You may distribute this code under the same terms as Perl itself.
71
72
73
74perl v5.12.0                      2010-0S5Q-L1:2:Translator::Parser::DBIx::Class(3)
Impressum