Changeset 34129
- Timestamp:
- 06/24/09 21:44:54 (4 years ago)
- Location:
- lang/perl/DBIx-CouchLike/trunk
- Files:
-
- 3 modified
-
lib/DBIx/CouchLike.pm (modified) (2 diffs)
-
t/02_view.t (modified) (1 diff)
-
xt/04_benchmark.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/DBIx-CouchLike/trunk/lib/DBIx/CouchLike.pm
r34128 r34129 9 9 use DBIx::CouchLike::Iterator; 10 10 11 our $VERSION = '0.0 7';11 our $VERSION = '0.08'; 12 12 our $RD; 13 13 __PACKAGE__->mk_accessors(qw/ dbh table utf8 _json /); … … 208 208 $sql .= q{ AND m.key LIKE ? }; 209 209 push @param, $query->{key_like}; 210 } 211 elsif ( exists $query->{key_start_with} ) { 212 my ($part, @value) 213 = $self->_start_with("m.key" => $query->{key_start_with}); 214 $sql .= q{ AND } . $part; 215 push @param, @value; 210 216 } 211 217 -
lang/perl/DBIx-CouchLike/trunk/t/02_view.t
r34128 r34129 86 86 ]; 87 87 88 89 @res = $couch->view("tags/name", { key_start_with => "c" }); 90 is_deeply \@res => [ 91 { key => "cat", value => "animal", id => $a_id }, 92 { key => "cat", value => "unix command", id => $u_id }, 93 ]; 94 95 @res = $couch->view("tags/name", { key_start_with => "d" }); 96 is_deeply \@res => [ 97 { key => "dog", value => "animal", id => $a_id }, 98 ]; 99 88 100 @res = $couch->view("tags/name", { key => {"<>" => "dog"} }); 89 101 is_deeply \@res => [ -
lang/perl/DBIx-CouchLike/trunk/xt/04_benchmark.t
r33620 r34129 71 71 my $r = $couch->view('count/by_tail_of_id', { key_like => "12%" }); 72 72 }, 73 map_key_sw => sub { 74 my $r = $couch->view('count/by_tail_of_id', { key_start_with => "12" }); 75 }, 73 76 map_key_docs => sub { 74 77 my $r = $couch->view('count/by_tail_of_id', { key => "12", include_docs => 1, });
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)