</div>
<div class="slide">
- <h1>splitting logic cleanly</h1>
- <p>Foo::Schema::Result::Foo = an individual row</p>
- <p>Foo::Schema::ResultSet::Foo = searches / results</p>
+ <h1>Splitting Logic Cleanly</h1>
+ <p>MyApp::Schema::Result::Foo = individual row</p>
+ <p>MyApp::Schema::ResultSet::Foo = searches / table </p>
</div>
<div class="slide">
- <h1>using your Schema</h1>
- <pre>example usage code goes here</pre>
+ <h1>Using your Schema</h1>
+<pre>#!perl
+use strict; use warnings;
+use lib 'lib';
+use MyApp::Schema;
+my $schema = MyApp::Schema->connect($dns, $user, $pass);
+my $author_rs = $schema->resultset('Author');
+my $author = $author_rs->create({
+ name => 'Douglas Adams',
+});
+my $book = $author->add_to_books({
+ title => '42',
+});
+</pre>
</div>
<div class="slide">
</div>
<div class="slide">
- <h1>Schema::Loader</h1>
-<pre>Foo::Schema::Result::Authors->table("authors");
-Foo::Schema::Result::Authors->add_columns(
- id => {
- data_type => "INT",
- default_value => undef,
- is_nullable => 0,
- size => 8
- },
- title => {
- data_type => "VARCHAR",
- default_value => undef,
- is_nullable => 1,
- size => 255,
- },
-);
-Foo::Schema::Result::Authors->set_primary_key("id");</pre>
- </div>
-
- <div class="slide">
- <h1>Schema::Loader</h1>
-<pre>Foo::Schema::Result::Books->table("books");
-Foo::Schema::Result::Books->add_columns(
- id => {
- data_type => "INT",
- default_value => undef,
- is_nullable => 0,
- size => 8
- },
- name => {
- data_type => "VARCHAR",
- default_value => undef,
- is_nullable => 1,
- size => 255,
- },
- author => {
- data_type => "INT",
- default_value => undef,
- is_nullable => 1,
- size => 8
- },
-);
-Foo::Schema::Result::Books->set_primary_key("id");</pre>
- </div>
-
- <div class="slide">
- <h1>Schema::Loader</h1>
-<pre>Foo::Schema::Result::Authors->has_many(books => "Foo::Schema::Books",
- { "foreign.author" => "self.id" });
-
-Foo::Schema::Result::Books->belongs_to(author => "Foo::Schema::Authors",
- { id => "author" });</pre>
- </div>
-
- <div class="slide">
<h1>SQL - debugging</h1>
<pre>INSERT INTO authors (name)
VALUES (?): 'Douglas Adams'
<div class="slide">
<h1>overloading</h1>
-<pre>Foo::Schema::Result::Books
-Foo::Schema::ResultSet::Books
-Foo::Schema::Result::Authors
-Foo::Schema::ResultSet::Books</pre>
+<pre>MyApp::Schema::Result::Book
+MyApp::Schema::ResultSet::Book
+MyApp::Schema::Result::Author
+MyApp::Schema::ResultSet::Book</pre>
</div>
<div class="slide">
use strict;
use warnings;
+# Result code here
+
sub isbn {
my $self = shift;