From: Arthur Axel 'fREW' Schmidt Date: Tue, 22 Jun 2010 13:26:10 +0000 (-0500) Subject: rearrange slides so that searching is more obvious X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e4676fb830e38b1c8665aa47a13e314b83d6880b;p=dbsrgits%2Fdbix-class-introduction-presentation.git rearrange slides so that searching is more obvious --- diff --git a/slideshow.html b/slideshow.html index 11f0704..485e759 100644 --- a/slideshow.html +++ b/slideshow.html @@ -281,6 +281,33 @@ $delete->execute($book_id);
+

SQL: Search

+
my $sth = $dbh->prepare('
+   SELECT title,
+   authors.name as author_name
+   FROM books
+   WHERE books.name LIKE "%monte cristo%" AND
+   books.topic = "jailbreak"
+');
+
+
+ +
+

DBIC: Search

+
+my $book = $book_rs->search({
+   'me.name'  => { -like => '%monte cristo%' },
+   'me.topic' => 'jailbreak',
+})->next;
+
+ +
+ +

OO Overidability

-

SQL::Abstract

-
my $resultset = $book_rs->search({
-   name => { -like => "%$nick%" },
-});
- -
- -

Result vs ResultSet