X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FManual%2FExample.pod;h=2fe95d770dabf7cfd6deb5476f34f6f514ddc223;hb=a2bd379666d729133d65c85dc775627937084b18;hp=e41945b22cacb582b4a7f63d47a926a70967ef5c;hpb=a5bd5d88980681e140bc910d0cd38dd21db48218;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Manual/Example.pod b/lib/DBIx/Class/Manual/Example.pod index e41945b..2fe95d7 100644 --- a/lib/DBIx/Class/Manual/Example.pod +++ b/lib/DBIx/Class/Manual/Example.pod @@ -11,7 +11,7 @@ as the database frontend. The database consists of the following: table 'artist' with columns: artistid, name - table 'cd' with columns: cdid, artist, title + table 'cd' with columns: cdid, artist, title, year table 'track' with columns: trackid, cd, title @@ -104,7 +104,7 @@ MyApp/Schema/Result/Cd.pm: use base qw/DBIx::Class::Core/; __PACKAGE__->load_components(qw/InflateColumn::DateTime/); __PACKAGE__->table('cd'); - __PACKAGE__->add_columns(qw/ cdid artist title/); + __PACKAGE__->add_columns(qw/ cdid artist title year/); __PACKAGE__->set_primary_key('cdid'); __PACKAGE__->belongs_to('artist' => 'MyApp::Schema::Result::Artist'); __PACKAGE__->has_many('tracks' => 'MyApp::Schema::Result::Track'); @@ -137,10 +137,6 @@ insertdb.pl my $schema = MyApp::Schema->connect('dbi:SQLite:db/example.db'); - # here's some of the SQL that is going to be generated by the schema - # INSERT INTO artist VALUES (NULL,'Michael Jackson'); - # INSERT INTO artist VALUES (NULL,'Eminem'); - my @artists = (['Michael Jackson'], ['Eminem']); $schema->populate('Artist', [ [qw/name/], @@ -351,7 +347,7 @@ It should output: A reference implementation of the database and scripts in this example are available in the main distribution for DBIx::Class under the -directory F. +directory F. With these scripts we're relying on @INC looking in the current working directory. You may want to add the MyApp namespaces to @@ -361,17 +357,22 @@ The F script is an excellent start for testing your database model. This example uses L to load in the -appropriate L classes from the MyApp::Schema::Result namespace, -and any required resultset classes from the MyApp::Schema::ResultSet -namespace (although we created the directory in the directions above we -did not add, or need to add, any resultset classes). +appropriate L classes from the +C namespace, and any required +L classes from the +C namespace (although we created the directory +in the directions above we did not add, or need to add, any resultset +classes). + +=head1 FURTHER QUESTIONS? -=head1 TODO +Check the list of L. -=head1 AUTHOR +=head1 COPYRIGHT AND LICENSE - sc_ from irc.perl.org#dbix-class - Kieren Diment - Nigel Metheringham +This module is free software L +by the L. You can +redistribute it and/or modify it under the same terms as the +L. =cut