From: Peter Rabbitson Date: Mon, 26 Aug 2013 12:33:37 +0000 (+0200) Subject: Sync Example.pod with reality, though in fairness it just needs to die... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5b5453978fe28bf7ab0af79584e01ba7bb7bf59d;p=dbsrgits%2FDBIx-Class-Historic.git Sync Example.pod with reality, though in fairness it just needs to die... --- diff --git a/lib/DBIx/Class/Manual/Example.pod b/lib/DBIx/Class/Manual/Example.pod index 432b292..59b114e 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'); @@ -347,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 @@ -357,10 +357,12 @@ 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 TODO diff --git a/lib/DBIx/Class/Manual/QuickStart.pod b/lib/DBIx/Class/Manual/QuickStart.pod index 9f401f4..1d7415a 100644 --- a/lib/DBIx/Class/Manual/QuickStart.pod +++ b/lib/DBIx/Class/Manual/QuickStart.pod @@ -28,7 +28,7 @@ mentioned earlier, the next command will download and unpack it: Inspect the database: - DBIx-Class/examples/Schema$ echo .dump | sqlite3 db/example.db + DBIx-Class/examples/Schema$ sqlite3 db/example.db .dump You can also use a GUI database browser such as L. @@ -38,7 +38,7 @@ C class is the entry point for loading the other classes and interacting with the database through DBIC and the C classes correspond to the tables in the database. L shows how to write all that Perl code. That is almost never necessary, though. Instead use -L (part of the distribution C) to +L (part of the distribution L) to automatically create schema classes files from an existing database. The chapter L below shows an example invocation.