| File: | lib/SQL/Statement.pm |
| Coverage: | 94.3% |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | package SQL::Statement; | ||||||
| 2 | |||||||
| 3 | 26 26 26 | 195 77 207 | use strict; | ||||
| 4 | 26 26 26 | 260 78 192 | use warnings; | ||||
| 5 | 26 26 26 | 278 86 324 | use base 'Clone'; | ||||
| 6 | 26 26 26 2430 | 286 75 368 19873 | use overload '""' => sub { $_[0]->generate }; | ||||
| 7 | |||||||
| 8 | sub reset { | ||||||
| 9 | 64 | 0 | 2226 | my $self = shift; | |||
| 10 | 64 64 | 234 435 | %$self = %{ $self->new(@_) }; | ||||
| 11 | 64 | 182 | $self; | ||||
| 12 | } | ||||||
| 13 | |||||||
| 14 | sub where { | ||||||
| 15 | 2171 | 0 | 11697 | my $self = shift; | |||
| 16 | 2171 | 14190 | if (@_ == 2) { | ||||
| 17 | 2123 2123 | 7256 27658 | push @{ $self->{where} }, [$_[0], '=', $_[1]]; | ||||
| 18 | } else { | ||||||
| 19 | 48 48 | 196 650 | push @{ $self->{where} }, [@_]; | ||||
| 20 | } | ||||||
| 21 | 2171 | 18137 | $self; | ||||
| 22 | } | ||||||
| 23 | |||||||
| 24 | 1; | ||||||
| 25 | |||||||